954,557 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

how to do two things at once?

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.

thanks

nephish
Light Poster
39 posts since Jun 2005
Reputation Points: 10
Solved Threads: 0
 

Look in your Python documentation under thread or threading.

vegaseat
DaniWeb's Hypocrite
Moderator
5,989 posts since Oct 2004
Reputation Points: 1,345
Solved Threads: 1,417
 

threading, yep. going to take some time to learn this. but appears to be what i need.
thanks

nephish
Light Poster
39 posts since Jun 2005
Reputation Points: 10
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You