I want to create a graphical python application that can execute some external programs on Linux without showing the terminal.
First, I tried to use subprocess.run() to see if it actually works, but Python 3.7.3 shows no results to the code I wrote.
import subprocess
subprocess.run(['sudo', 'apt', 'update'])
I changed it to see any results:
import subprocess
a = subprocess.run(['sudo', 'apt', 'update'])
print(a)
but it shows this result instantly:
CompletedProcess(args=['sudo', 'apt', 'update'], returncode=1)
This script will take at least 5 seconds to be finished, and it requires sudo privileges to be able to run it in the first place, so I don't think that Python shell executed this script.