[Tutor] how to monitor if their data in a variable/object

Wayne srilyk at gmail.com
Tue Jul 21 00:09:54 CEST 2009


On Mon, Jul 20, 2009 at 5:01 PM, Amit Sethi <amit.pureenergy at gmail.com>wrote:

> Hi , I am writing a python gtk application in which I am required to
> fetch a large amount of data from web , now i want to create a wait
> dialog for the user to know that I am still fetching data .The
> question is how can i monitor that the required data has been fetched
> . I could have a variable that is given a particular value when data
> has been fetched . But how can I   keep checking if the variable has
> got a value or not.


It really depends on how you're fetching the data. If you write your own
method to read a few kilobytes at a time, you can easily update a status
bar. Otherwise if you know the file it's downloading to (i.e. not a temp
file) you could continually call os.stat to update the status bar
(especially if you know the size it's supposed to be in the end).

HTH,
Wayne
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20090720/fbd77d13/attachment-0001.htm>


More information about the Tutor mailing list