[Tutor] how to make a script do two things at once.

Michael Lange klappnase at freenet.de
Mon Aug 22 20:07:42 CEST 2005

On Sun, 21 Aug 2005 16:23:20 -0500
nephish <nephish at xit.net> wrote:

> Hey there,
> i have a simple question about getting a script to do
> two things at once.
> like this.
> for i in range(100):
>     print i
>     time.sleep(.2)
>     if i == 15:
>         os.system('python /home/me/ipupdate.py')
> print 'done'
> when i run this, it stops at 15 and runs the script called out in the 
> os.system line. i know it is supposed to do that. But, how could i get a 
> script to do this without stopping the count (or delaying it unill the 
> script called exits) I don' t have to run it this way, i can import it 
> if necessary as a module. or whatever will work so i can execute two 
> things at once.

If you just need to call a unix system command you can simply add "&" to the command string to
make it run in the background.



More information about the Tutor mailing list