I am making an application through python tkinter; I am not able to understand how I can run a shell script with it.
My use case is , when I press a button it will invoke a shell script and display its output in GUI.
I am making an application through python tkinter; I am not able to understand how I can run a shell script with it.
My use case is , when I press a button it will invoke a shell script and display its output in GUI.
You're looking for the subprocess module:
https://docs.python.org/3/library/subprocess.html
An example:
subprocess.run(["ls"]). # run ls
output = subprocess.check_output(["ls"]) # grab the output of ls