943,994 Members | Top Members by Rank

Ad:
  • Python Discussion Thread
  • Marked Solved
  • Views: 2708
  • Python RSS
Aug 21st, 2005
0

how to do two things at once?

Expand Post »
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
Similar Threads
Reputation Points: 10
Solved Threads: 0
Light Poster
nephish is offline Offline
39 posts
since Jun 2005
Aug 22nd, 2005
0

Re: how to do two things at once?

Look in your Python documentation under thread or threading.
Moderator
Reputation Points: 1333
Solved Threads: 1403
DaniWeb's Hypocrite
vegaseat is offline Offline
5,792 posts
since Oct 2004
Aug 22nd, 2005
0

Re: how to do two things at once?

threading, yep. going to take some time to learn this. but appears to be what i need.
thanks
Reputation Points: 10
Solved Threads: 0
Light Poster
nephish is offline Offline
39 posts
since Jun 2005

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Python Forum Timeline: How to use 'top' using Python
Next Thread in Python Forum Timeline: Need help with a simple python program





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC