Launching scripts in several terminals

Posted on 2005-05-05
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

    Author Comment


    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

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

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

    Author Comment


    I was thinking about it,

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

    Accepted Solution

    You can mimic that if you want:

    import os
    os.system('python &')
    os.system('python &')

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    Join & Write a Comment

    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…
    This article will show the steps for installing Python on Ubuntu Operating System. I have created a virtual machine with Ubuntu Operating system 8.10 and this installing process also works with upgraded version of Ubuntu OS. For installing Py…
    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 if, else, and elif statements in Python 2.7. Use "if" statements to test a specified condition.: The structure of an if statement is as follows: (CODE) Use "else" statements to allow the execution of an alternative, if the …

    729 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

    Need Help in Real-Time?

    Connect with top rated Experts

    24 Experts available now in Live!

    Get 1:1 Help Now