473,480 Members | 1,755 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How can I schedule a task to run every 10 seconds in Python?

17 New Member
Dear Experts:

I am writing one test program with Python which is running multiple threads in parallel. I hope to add another thread to display the test status every 10 seconds. Could you please tell me how I can schedule a task to run every 10 seconds in Python?

I defined one function return_status() and tried the Timer object of threading as follows, but it only run once after 10 seconds. I hope it can run multiple times and invoke every 10 seconds.

Expand|Select|Wrap|Line Numbers
  1. running_status = threading.Timer(10, self.return_status)    # return test status every 10 seconds
  2. running_status.start()
  3.  
Thank you very much in advance!

Regards,
Haiyan
Aug 19 '10 #1
0 1294

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

Similar topics

1
1505
by: Mullin Yu | last post by:
How can I do so? Can I write a windows service that will run a bat file when the system shuts down? I want to write a service because I can create a schedule task by Windows Scheduler only when...
6
1613
by: Beren | last post by:
Hello, I need to run a routine every first day of the month, even when there is no page request. What would be the best way of achieving this ? A cache variable ? Thanks, Beren
1
3753
by: krallabandi | last post by:
Hi, I have a console application written in VB.NET. I schedule the job using windows 2000 scheduler. It is all working fine but, its opening a console when it was running. How to disable the...
2
2628
by: ycoci0 | last post by:
Hi all, Not exactly new to Python, just have not programmed a time dependent function using it before. I imagine that many of you may also program some JavaScript and may be familiar with...
6
3626
by: nilesh soni | last post by:
HELLO EVERY ONE ! I HAVE TO SCHEDULED A TASK TO RUN EVERY DAY AT 4PM, TO CHECK THE SIZE OF THE NOTIFICATION LOG FILE , IF IT EXCEEDS 5MB, THEN I NEED TO RENAME THE FILE AND START WITH A NEW ONE...
1
6927
by: Dean Slindee | last post by:
I am writing a VB.Net application that will replace a series of DTS packages. The DTS packages run once a day at a scheduled time automatically. Would this new application be a Windows Service...
1
2992
by: Alan T | last post by:
I have created a scheduled task successfully programmaticall. However, there is something wrong in the process. When the scheduled task is running and stopped, the result was: "0xe0434f4d". I...
0
1633
by: Shina35 | last post by:
Hi All, i scheduled a windows task that is running VBS file that run QTP. the script is running once at the time i set and the day after at the same time it's not running although i set it to run...
2
6950
NeoPa
by: NeoPa | last post by:
My server is running Windows 2000 (All latest SPs & updates) and I need to start a job in the early hours with a specific network account and in interactive mode. I have been using the AT command...
6
5615
by: jumbojs | last post by:
I want to call a method in a web page that I want to call every hour on my web application and run the code. I have now Idea of how to do this. Any help would be appreciated. Thanks
0
6904
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
7037
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
7080
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
5326
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4770
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4476
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
2992
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1296
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
176
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.