I am new python (ver 2.7) programmer and I have a question how to open 2 terminals and output different message.
The main task of this program is open 2 terminals and output different message. Right now, I have 3 following files
- test.py -- it is the main file that suppose to open 2 terminals and call different python 2 files
- print1.py -- this is simple 1 line of code which print the line of "this is 1st terminal"
- print2.py -- same as print1.py. it output "this is 2nd terminal"
Currently, my test.py has following code:
import subprocess
subprocess.call(['gnome-terminal','-x','python print1.py'])
subprocess.call(['gnome-terminal','-x','python print2.py'])
When I execute the program, it opens two terminals and both of them tell "There was an error creating the child process for this terminal. Failed to execute child" . Then, I have tried to write full path of print1/print2.py but it still gives same error and I am get stuck in there. Please some give me some advice to solve this error.