0

I'm using LXDE, I would like to Launch a python script in a new terminal from another python script.

I would like the new python script to be totally independent.

I have tried a lot of things... Calling xterm (or x-terminal-emulator) directly from python with the subprocess.call or subprocess.Popen with or without shell=True argument, it didn't work. It gives me an error about display not being set.

I have also created a sh file which calls the other python script and tried to call it, same results.

Any way to do this?

2
  • Shall the scripts run parallel? Do you just want to have a new window? Do you need the new window or do you just want parallelism? Commented Dec 13, 2017 at 13:30
  • I need a new terminal for the script output Commented Dec 13, 2017 at 15:18

1 Answer 1

1

This works fine for me:

blocking:

import os
os.system("xterm -e \"python christmaskittens.py\"")

non blocking:

import os
os.system("xterm -e \"python christmaskittens.py\" &")
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.