Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/357.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ubuntu python:运行多脚本的接口_Python_Ubuntu_Interface - Fatal编程技术网

Ubuntu python:运行多脚本的接口

Ubuntu python:运行多脚本的接口,python,ubuntu,interface,Python,Ubuntu,Interface,我已经创建了一些python脚本,我必须每隔一段时间运行一次,但现在我必须不断键入或搜索脚本的位置才能执行它。我一直在寻找简单的软件来创建一个带有按钮的应用程序,但没有成功。我还看到了带有界面的“python?”脚本,其中可以使用箭头键选择选项,但是我也没有找到它是如何完成的。有人知道我如何制作一个这样的脚本,我可以打开界面并选择要执行的脚本吗?这真的会节省我很多时间。您可以创建GUI,并为每个按钮创建一个运行python脚本的函数,如下所示: # Create the button butto

我已经创建了一些python脚本,我必须每隔一段时间运行一次,但现在我必须不断键入或搜索脚本的位置才能执行它。我一直在寻找简单的软件来创建一个带有按钮的应用程序,但没有成功。

我还看到了带有界面的“python?”脚本,其中可以使用箭头键选择选项,但是我也没有找到它是如何完成的。

有人知道我如何制作一个这样的脚本,我可以打开界面并选择要执行的脚本吗?这真的会节省我很多时间。

您可以创建GUI,并为每个按钮创建一个运行python脚本的函数,如下所示:

# Create the button
button1 = Button \
    (root, text='Start script1!', command=lambda: script1())

def script1():
    os.system('python ~/path/to/script1.py')
def script2():
    os.system('python ~/path/to/script2.py')

我建议使用,因为该框架是在python上构建GUI的强大工具,可以将python代码中的脚本作为系统进程运行,您可以使用该模块。我想你知道如何使用谷歌查找教程=),你也可以通过GUI常见问题查看官方页面。谢谢大家!

谢谢!我在寻找时已经遇到了特金特,但我经常遇到麻烦。多亏了更多的youtube和你的代码,我才知道它是如何工作的