• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 245
  • Last Modified:

Launching scripts in several terminals


I have an python scripts that write to the shell terminal

Now I need to launch several instances of the scripts with a shell for each one,

How can I perform this??
  • 2
  • 2
1 Solution
RobertoDeAlbaAuthor Commented:

Something that will help me alot is to be aware when any of the launched scripts finished,
so I can deceide if relaunche it or not regarding some conditions.

It's not actually a Python question because use launch a Python (and any other) script _outside_ of Python,
i.e. bash> python script.py

So use bash (or whatever other environment you hace) capabilities to do so like
bash> python script1.py &
bash> python script2.py &
bash> ps
and see both scripts running simultaneously.
RobertoDeAlbaAuthor Commented:

I was thinking about it,

But does Is htere a way to do it under python?
You can mimic that if you want:

import os
os.system('python script1.py &')
os.system('python script2.py &')
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now