Nov-12-2023, 05:19 PM
I'm trying to create a GUI in Python which would accept a bash command like this
python OK21.py
and displayed all the outputs of this command including any graphics.
If I run from command line this
python OK21.py
it does so, but when trying to do it from GUI like here:
python OK21.py
and displayed all the outputs of this command including any graphics.
If I run from command line this
python OK21.py
it does so, but when trying to do it from GUI like here:
# import required modules
import os
import pyautogui
# prompts message on screen and gets the command
# value in val variable
value = pyautogui.prompt("Enter Shell Command")
# executes the command and returns
# the output in stream variable
stream = os.popen(value)
# reads the output from stream variable
out = stream.read()
pyautogui.alert(out)it displays only text outputs omitting the graphics present.
