I'm writing a program with Tkinter GUI, When the program is running it
need to be updated every five seconds (data comes from internet). How
should I do that ? How to make a function in main loop ? 6 1933
In article <11**********************@i13g2000prf.googlegroups .com>,
ReTrY <re****@gmail.comwrote:
> I'm writing a program with Tkinter GUI, When the program is running it need to be updated every five seconds (data comes from internet). How should I do that ? How to make a function in main loop ?
See the Tkinter example from my threads tutorial on my website.
--
Aahz (aa**@pythoncraft.com) <* http://www.pythoncraft.com/
I support the RKAB
"ReTrY" <re****@gmail.comwrote:
I'm writing a program with Tkinter GUI, When the program is running it
need to be updated every five seconds (data comes from internet). How
should I do that ? How to make a function in main loop ?
Short answer:
use the after method to set up a periodic scan of a queue.
In another thread, look for the new stuff, and put it on the queue when found.
there is a recipe for this sort of thing, but I keep losing links.
- Hendrik
On Jul 18, 3:24 am, ReTrY <ret...@gmail.comwrote:
I'm writing a program with Tkinter GUI, When the program is running it
need to be updated every five seconds (data comes from internet). How
should I do that ? How to make a function in main loop ?
I'm pretty sure the book "Programming Python 3rd Ed." by Lutz covers
this stuff in detail. I think it mentions using threads for this sort
of thing. The wxPython wiki has a good example that I think you could
adapt for Tkinter. Just use the threading code and wrap it in your
Tkinter code and I think you'll be good to go. Here's the link: http://www.wxpython.org/maillist.php
Good luck,
Mike
On Jul 18, 4:43 pm, a...@pythoncraft.com (Aahz) wrote:
In article <1184747090.102324.265...@i13g2000prf.googlegroups .com>,
ReTrY <ret...@gmail.comwrote:
I'm writing a program with Tkinter GUI, When the program is running it
need to be updated every five seconds (data comes from internet). How
should I do that ? How to make a function in main loop ?
See the Tkinter example from my threads tutorial on my website.
--
Aahz (a...@pythoncraft.com) <* http://www.pythoncraft.com/
I support the RKAB
There's also a good example on the wxPython wiki dealing with threads
that you should be able to adapt to Tkinter. http://wiki.wxpython.org/LongRunningTasks
Mike
Hendrik van Rooyen <ma**@microcorp.co.zawrote:
"ReTrY" <re****@gmail.comwrote:
I'm writing a program with Tkinter GUI, When the program is running it
need to be updated every five seconds (data comes from internet). How
should I do that ? How to make a function in main loop ?
Short answer:
use the after method to set up a periodic scan of a queue.
In another thread, look for the new stuff, and put it on the queue when found.
there is a recipe for this sort of thing, but I keep losing links.
<http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/82965.
Alex
"Alex Martelli" <al***@mac.comwrote:
Hendrik van Rooyen <ma**@microcorp.co.zawrote:
there is a recipe for this sort of thing, but I keep losing links.
<http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/82965.
thanks - but its probably no use - I predict I will lose this too...
: - )
- Hendrik This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: cwdjr |
last post by:
Real One has a page to copy on their site that detects if the browser
of a viewer of a page has Real One installed. The page is located at...
|
by: Paul |
last post by:
In real life situation, do we ever come across a situation where we
would need two base objects in an object.
A snippet is worth 1000 words (: so...
class Base
{
};
class Derived1:public Base...
|
by: Allan Adler |
last post by:
I'm trying to reinstall RedHat 7.1 Linux on a PC that was disabled when
I tried to upgrade from RH7.1 to RH9. This is presenting lots of unexpected
difficulties. Apart from wanting to keep the old...
|
by: Pavils Jurjans |
last post by:
Hallo,
It is know issue that due to the fact that computer has to store the real
numbers in limited set of bytes, thus causing a minor imprecision from the
decimal value that likely was stored....
|
by: David Scemama |
last post by:
Hi,
I'm writing a program using VB.NET that needs to communicate with a DOS
Pascal program than cannot be modified. The communication channel is through
some file databases, and I have a huge...
| |
by: Henry Wu |
last post by:
Hi, now that in .NET everything is on millimeter, I was wondering how
can one convert Pixel to Millimeter and any user's screen/monitor. I
saw the following code on how to convert pixel to...
|
by: support |
last post by:
Veteran Real Estate Investor Shares some of
his best Insider Secrets for successful investments!
www.RealEstateBeginners.ws
Have you ever wondered about investing in real
estate? Maybe one...
|
by: Raymond Hettinger |
last post by:
I am evaluating a request for an alternate version of itertools.izip()
that has a None fill-in feature like the built-in map function:
>>> map(None, 'abc', '12345') # demonstrate map's None...
|
by: DirtyHarry |
last post by:
Good day everyone. This sounds like a stupid question, but I became
just curious yesterday, and I looked up several textbooks. However, no
textbooks on computer language (that I have ) mentioned...
|
by: Tim |
last post by:
Folks,
Can anyone thow some clarifying light on the following?
I have come across a column with the same name and same data contents
defined on different tables, on some the column is defined...
|
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: 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...
|
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: 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...
|
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,...
|
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...
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
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...
| |