[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


Launching scripts in several terminals

Posted on 2005-05-05
Medium Priority
Last Modified: 2010-04-16

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??
Question by:RobertoDeAlba
  • 2
  • 2

Author Comment

ID: 13941586

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.

LVL 15

Expert Comment

ID: 13946792
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.

Author Comment

ID: 13947480

I was thinking about it,

But does Is htere a way to do it under python?
LVL 15

Accepted Solution

mish33 earned 1000 total points
ID: 13949170
You can mimic that if you want:

import os
os.system('python script1.py &')
os.system('python script2.py &')

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Variable is a place holder or reserved memory locations to store any value. Which means whenever we create a variable, indirectly we are reserving some space in the memory. The interpreter assigns or allocates some space in the memory based on the d…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
Learn the basics of strings in Python: declaration, operations, indices, and slicing. Strings are declared with quotations; for example: s = "string": Strings are immutable.: Strings may be concatenated or multiplied using the addition and multiplic…
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question