简体   繁体   中英

Python GUI to run python script without opening the IDE

Is there any quick way- library or an example- to create a simple GUI by python in order to run any python script separately? so that it is not necessary to have to open the python IDE or not to have it installed.

For example a simple window with "add the script path" and an "execute" button.

You could use tkinter - it is a pretty simple GUI library.

As for the backend, you could either import the other script (not recommended, as it will basically run the script, and could be malicious) or do something like:

# from https://stackoverflow.com/questions/1186789/what-is-the-best-way-to-call-a-script-from-another-script
exec(open("file.py").read())

You could also use subprocess or os.system to call python.

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