2024-06-14 04:15:58 发布
网友
我想题目不太准确
右边是我的剧本
Screenshot
它是一个机器人,可以自动执行一些操作。现在我想添加一些图形用户界面,但我不知道如何。你知道吗
就像你在左边看到的,我有“导入问题”,但是当我启动tkinter文件时,它会自动启动问题,而不考虑我的openBtn代码。你知道吗
如何将gui添加到我的每个命令中有问题吗?你知道吗
您需要将questions.py脚本分解为实际的函数。当命名空间在到达testkinter.py中import语句下面的逻辑之前被导入时,Python将只执行questions.py中的所有操作。你知道吗
questions.py
testkinter.py
因此,在questions.py中删除您的while True:语句,以支持如下函数定义:
while True:
def check_database(param): database check logic here
然后将questions.py中定义的函数链接到testkinter.py中的Tkinter按钮操作,如下所示:
w = tkinter.Button( fenetre, command=check_database )
我的问题还没解决。。。有人帮忙吗?你知道吗
您需要将
questions.py
脚本分解为实际的函数。当命名空间在到达testkinter.py
中import语句下面的逻辑之前被导入时,Python将只执行questions.py
中的所有操作。你知道吗因此,在
questions.py
中删除您的while True:
语句,以支持如下函数定义:def check_database(param): database check logic here
然后将
questions.py
中定义的函数链接到testkinter.py
中的Tkinter按钮操作,如下所示:w = tkinter.Button( fenetre, command=check_database )
我的问题还没解决。。。有人帮忙吗?你知道吗
相关问题 更多 >
编程相关推荐