I am having a python page named Home.py and it is containing a button named View Reports . When I click this button I want another python page named Reports.py to get executed. I developed the UI using tkinter.
Thanks and regards in advance.
Try the below code. Works for me.
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)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.