我有一个名为Home.py的python页面,它包含一个名为View 的按钮。单击此按钮时,希望执行另一个名为Reports.py的python页面。我用tkinter开发了UI。
事先谢谢并问好。
发布于 2020-03-19 09:26:18
试试下面的代码。为我工作。
def RunWrapper():
wrapper = ['python', 'Reports.py']
result1 = subprocess.Popen(wrapper, stdin=subprocess.PIPE, stderr=subprocess.PIPE, stdout=subprocess.PIPE)
out1, err1 = result1.communicate()
status_wrapper=out1.decode("utf-8")
tkinter.messagebox.showinfo("Execution of script is done")
Button.configure(pady="0",text='''Execute''',command=RunWrapper)https://stackoverflow.com/questions/60752246
复制相似问题