3
I’m doing a project here and I need to open another terminal window, which runs the command ls
.
I’ve tried with subprocess
but it was a mistake:
Traceback (most recent call last):
File "tests.py", line 8, in <module>
subprocess.Popen(cmd, stdout=subprocess.PIPE)
File "/usr/lib/python2.7/subprocess.py", line 679, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1249, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
My terminal is the bash
.
How can I do that ?
@Qmechanic73 obitive result with this command: os.system("xterm -e 'sudo apt-get update'")
– Pedro Souza
But with the command up the program waits for execution in xterm ends for continuing execution of the program, would have a way to proceed with the program without the execution of the?
– Pedro Souza
@Pedrosouza Use the
subprocess.Popen
he does that. :)– stderr
Now it worked out, thank you!
– Pedro Souza