471,328 Members | 1,744 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,328 software developers and data experts.

Timer - Basic

Hello, I have a hard time to make my script to carry on @ :
class testit(Thread):
see below question mark ?????????????
any suggestion ?

Brgds/Charlie

Expand|Select|Wrap|Line Numbers
  1. entrer =raw_input("Enter e.i.: Sat Aug 25 09:56:00 2007  :")
  2.  
  3.  
  4. def printTime():
  5.      print time.ctime( )
  6.   t = None
  7. while True:
  8.   if t is None or not t.isAlive():
  9.     t = Timer(1.0, printTime)
  10.     t.start()
  11.   if time.ctime () == entrer:
  12.  
  13. ????????????????????????????????????????????      
  14.  
  15. class testit(Thread):
  16.    def __init__ (self,ip):
  17.       Thread.__init__(self)
  18.       self.ip = ip
  19.       self.status = -1
  20.    def run(self):      
  21.       pingaling = os.popen("ping "+self.ip+" -n 10 ","r")
  22.  
  23. # This code is what each parallel thread does
  24. # the 'run' method is triggered when 'start' is called
  25.       while 1:
  26.          line = pingaling.read()
  27.          if not line: break
  28.          print line
  29.  
  30. pinglist = []
  31.  
  32. for ip in ip_list:
  33.    current = testit(ip)
  34.    pinglist.append(current)
  35.    current.start()
  36.  
  37. print time.ctime()
  38.  
  39.  
Aug 29 '07 #1
0 762

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

4 posts views Thread by William Bub | last post: by
5 posts views Thread by Nathan Sokalski | last post: by
3 posts views Thread by zurg | last post: by
2 posts views Thread by John David Thornton | last post: by
8 posts views Thread by Jerry Spence1 | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.