0

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.

jess
  • 81
  • 1
  • 7
  • 2
    This is what the command line line is for: `cmd` on Windows, `bash` on Linux or MacOS. Most of us run our Python scripts from there, not from an IDE at all. – Tim Roberts Sep 17 '22 at 00:27

1 Answers1

0

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.

bobtho'-'
  • 128
  • 2
  • 8
  • Thanks @bobtho'-' I will check tkinter the idea is basically to give someone who does not have any programming knowledge the simple gui python.exe to run the code. – jess Sep 17 '22 at 00:36