473,389 Members | 1,077 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,389 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 808

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

Similar topics

4
by: William Bub | last post by:
Is there an accurate way to create a "stopwatch" good to 1/10 of a second? I'm not sure if I should use the timer control, or some way to access the computer timer. I found the following site...
0
by: Eli | last post by:
I'm developing a Visual Basic .Net app that interacts with Visio 2002. I have an event handler in VB to handle the Visio "SelectionChanged" event. This event handler is called when the event is...
5
by: Nathan Sokalski | last post by:
I am trying to learn how to use the System.Timers.Timer control to perform an action every certain amount of time. However, the Elapsed event doesn't want to fire, but I can't figure out why. I...
3
by: zurg | last post by:
As far as I remember somewhere here was posted a question about Timer that was stoping at midnight(0.00 a.m.). I'm going to face this problem tommorow (implemeting a long working timer) so if...
10
by: WhiteSocksGuy | last post by:
Help! I am new to Visual Basic .Net (version 2002) and I am trying to get a System.Timers.Timer to work for me to display a splash screen for about two seconds and then load the main form. I have...
2
by: John David Thornton | last post by:
I've got a Windows Service class, and I put a System.Threading.Timer, and I've coded it as shown below. However, when I install the service and then start it in MMC, I get a peculiar message: ...
3
by: Tom | last post by:
When using system.timers.timer, which should one use to start/stop the timer? Start/Stop, or Enabled=True/False? If what I read is true, both really do the same thing, so I don't know if there is...
9
by: archana | last post by:
Hi all, I want to know about interval of timer. I am using timer in windows service.I head somewhere that when i set interval property of timer while setting interval, restart time of Pc is...
2
by: terry guthrie | last post by:
I need some help with visual basic code, I need to create a timer that will be visible while playing a game, i know there is a timer in the tools that you pull over to the project and is hidden, and...
8
by: Jerry Spence1 | last post by:
Do Timers operate on the UI thread, or do they have it's own thread? I'm trying to assess the pros and cons for using a timer or a thread for a certain application. -Jerry
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.