【问题标题】:Python GUI for my shell scripting用于我的 shell 脚本的 Python GUI
【发布时间】:2017-04-26 15:32:14
【问题描述】:

我写了一些简单的 Linux shell 脚本。现在我想弄清楚我能否拥有一个用 python 开发的 GUI 并从 GUI 触发我的 shell 脚本。 这可能吗。我怎样才能做到这一点。请提供任何想法或示例。
谢谢。

【问题讨论】:

  • 您是在问“是否有可能用 Python 构建一个 GUI,我可以从中触发 shell 脚本”?
  • 1) google "python gui" 2) 打开第一个答案,即python wiki。 3)选择框架 4)去那个框架的教程。 /// 也值得一读,python 官方GUI FAQ

标签: python shell user-interface scripting


【解决方案1】:

只需确保 python 可执行文件在您的 PATH 环境变量中,然后添加到您的脚本中

python 路径/to/the/python_script.py 详情:

在文件job.sh中,放这个

!/bin/sh

python python_script.py

执行此命令以使脚本可以为您运行:chmod u+x job.sh 运行它:./job.sh

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-08-09
    • 2017-12-29
    • 2011-03-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多