I have this code in main.py which opens a new terminal with running test.py
main.py
import subprocess
subprocess.call(['xterm', '-e', 'python test.py'])
test.py
print('HELLO')
But when the script finishes it directly closes the terminal OR when error occurs it closes the terminal, is there a way to keep the terminal open when script finishes or error occurs? (so I can see whats happening)
Thanks.
You can use only the
input()at the end of your code but if an error occurs it will still close. So instead you can use this: