I am wondering what is the best way to create a timer, like an alarm, once it
reaches a time, it triggers an event. I have a way of doing this but it
seems like it isn't good at all. If it helps at all I am using a Tkinter,
but that probably doesn't mean much. The way I was doing it was using a
while loop, and just saying while current time is not = to trigger time, do
nothing, and when it is, do event.
--
View this message in context: http://www.nabble.com/best-way-to-cr...p17815502.html
Sent from the Python - python-list mailing list archive at Nabble.com. 3 1623
You can think of doing with import time module and time.sleep(n) but
you have to calculate n in seconds.
Subhabrata.
Alexnb wrote:
I am wondering what is the best way to create a timer, like an alarm, once it
reaches a time, it triggers an event. I have a way of doing this but it
seems like it isn't good at all. If it helps at all I am using a Tkinter,
but that probably doesn't mean much. The way I was doing it was using a
while loop, and just saying while current time is not = to trigger time, do
nothing, and when it is, do event.
--
View this message in context: http://www.nabble.com/best-way-to-cr...p17815502.html
Sent from the Python - python-list mailing list archive at Nabble.com.
On 13 Giu, 07:42, Alexnb <alexnbr...@gmail.comwrote:
I am wondering what is the best way to create a timer, like an alarm, once it
reaches a time, it triggers an event. I have a way of doing this but it
seems like it isn't good at all. If it helps at all I am using a Tkinter,
but that probably doesn't mean much. The way I was doing it was using a
while loop, and just saying while current time is not = to trigger time, do
nothing, and when it is, do event.
--
View this message in context:http://www.nabble.com/best-way-to-cr...15502p17815502....
Sent from the Python - python-list mailing list archive at Nabble.com.
I think that threading.Timer could be what you're searching for.
--- Giampaolo http://code.google.com/p/pyftpdlib/
On Jun 12, 11:42 pm, Alexnb <alexnbr...@gmail.comwrote:
I am wondering what is the best way to create a timer, like an alarm, once it
reaches a time, it triggers an event. I have a way of doing this but it
seems like it isn't good at all. If it helps at all I am using a Tkinter,
but that probably doesn't mean much. The way I was doing it was using a
while loop, and just saying while current time is not = to trigger time, do
nothing, and when it is, do event.
Tkinter makes a big difference here. Like most (all?) event loops, it
provides a way to call a function after a specified amount of time.
Here's two pages I found: http://mail.python.org/pipermail/pyt...st/101233.html http://www.astro.washington.edu/owen...ary.html#After
Note that it only fires once. If you want it to fire again you're
callback will have to setup another timer. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Jason Gates |
last post by:
Dear all
I have written a very complex web app for intranet use. It allows
users to search a large database and then returns formatted results. I
am currently employing a method as below:
1....
|
by: Rafal M |
last post by:
Hi,
Is it possible to create timer 9600/s in C?
Regards,
Rafal
|
by: andrewcw |
last post by:
I am trying to do a windows service with C#. I am using as
a base the VB.NET article in VS, but I thing the
WITHEVENTS timer notation is a delegate. Can anyone
provide sample code & anh hints. ...
|
by: jam |
last post by:
Dear all,
I am wrtiing a console application and doing some test on timer, the below
is my sample code I got from some site, but I cannot make it work...
Error is
'System.Timers.Timer' does not...
|
by: Ronald S. Cook |
last post by:
What is the best way to structure my Windows form so that when it is dragged
bigger (i.e. maximized) or smaller, the controls will reorganize themselves
"properly"?
Assume I have 4 logical...
|
by: juglesh |
last post by:
Hello, I've searched and d/l'd but cant seem to find a way of creating
a semi-transparent drop shadow for an image.
Let me say, be fore I go on, I *do not* want one of those scripts that
resizes...
|
by: John |
last post by:
I want to write a quick app that will remind me not to slouch at the
computer with an Outlook "New Mail Desktop Alert" style pop-up every 15
minutes or so.
What I'd like advice on is the best...
|
by: DaTurk |
last post by:
Hi,
I'm creating an application that will need to use a timer to do a
static method call every second. My question, is what would be the
best timer to use? I know there are several, but I'd...
|
by: tomer |
last post by:
Hi,
I'm using vb.net.
How can I create timer within aspx page that show the time ?
Thanks
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
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,...
|
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: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
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,...
| |