简体   繁体   中英

How to launch another program in GUI (python tkinter)

i wrote a simple GUI using Python Tkinter. When i click a button it launches another program. But the GUI window stays there waiting for the the program to exit. I want the GUI to launch the program on Button1 and I can click on Button2 to run the test. I used os.system() to launch the program. Pls advise.

thanks maximus

Yes, os.system() will wait.

As the documentation for os.system() points out, you might want to replace it by using the subprocess module, where there are many different ways to start commands and where you can choose if you want to wait for it to finish or not.

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM