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 1629
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...@gma il.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...@gma il.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. Create a global database connection
2. Open a recordset that searches the database
3. Loop through recordset calling the relevant function from an...
|
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. Thanks Andrew
|
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 contain a definition for 'Tick'
So what should i do???
the final thing I wanna get is, I have a console will call a exe running in
background,...
|
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 sections of controls. Do I create 4 panels and dock
them a certain way? I'm just looking for the most normal/best practice.
| |
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 your image a bit to the left and bottom, and then grafts a
shadow onto it. I want to use a full shadow (it would be about as big
as the image) and...
|
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 method of timing and displaying the
pop-ups that would have the lowest performance impact for other running
applications?
Best regards
|
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 like to use a
timer that is probably the most reliable, and hopefully designed with
high performance in mind. Thank you in advance.
|
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: 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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language...
|
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
| |
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
|
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
|
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
|
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes...
|
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 then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert...
|
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in...
| |
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |