Good to be subscribed again, I was subscribed about 4 or 5 years ago. wxPython newbie here.
I've done some googling on my problem but unfortunately I haven't been able to find anything to help me.
I have a little app that downloads a file when you press a button. Currently of course the button just stays pressed until the download finishes. I want the download to start, then let me do something else, like maybe have an animation or something running on the side to indicate that something is happening, then once the download completes I want it to tell me that, and then I will change the indicator to say "Download complete" or something similar.
Now I'm sure this isn't very difficult to accomplish but I'm really a bit stuck. Any suggestions will be appreciated. I will post code samples etc. if needed.
Robin saw your request and used the Time Machine again…
You’ll find the bits of code you need already one your machine if you downloaded The Demo. They are conveniently located in the “Processes and Events” part of the Demo. You’ll find there examples for starting threads and for IPC.
Now I’m sure this isn’t very difficult to accomplish but I’m really a
bit stuck. Any suggestions will be appreciated. I will post code
samples etc. if needed.
On 10/5/07, *Wayne Koorts* <wayne@wkoorts.com > <mailto:wayne@wkoorts.com>> wrote:
Now I'm sure this isn't very difficult to accomplish but I'm really a
bit stuck. Any suggestions will be appreciated. I will post code
samples etc. if needed.
Robin saw your request and used the Time Machine again....
You'll find the bits of code you need already one your machine if you downloaded The Demo. They are conveniently located in the "Processes and Events" part of the Demo. You'll find there examples for starting threads and for IPC.
Thanks for the response Peter. I have looked in the demo (usually my first try - always open on my PC when I'm coding) but I guess if you say it's in there then I haven't looked hard enough. I'll have another look, thanks.
Robin saw your request and used the Time Machine again....
You'll find the bits of code you need already one your machine if you downloaded The Demo. They are conveniently located in the "Processes and Events" part of the Demo. You'll find there examples for starting threads and for IPC.
Thanks for the response Peter. I have looked in the demo (usually my first try - always open on my PC when I'm coding) but I guess if you say it's in there then I haven't looked hard enough. I'll have another look, thanks.
I've had a look through and done some more googling / python doco / soul searching etc. and I'm still having a problem. Can anyone tell me why the following doesn't work?
def downloadVid(self, e):
thread.start_new_thread(self.bgDownloadProc, ())
while self.lockDL.locked():
self.gagProgress.Pulse()
sleep(1)
It just tells me that I'm trying to release a lock that's already been released. All I want is for the progress bar to pulse while the file is downloading then stop at the end.
Robin saw your request and used the Time Machine again....
You'll find the bits of code you need already one your machine if you downloaded The Demo. They are conveniently located in the "Processes and Events" part of the Demo. You'll find there examples for starting threads and for IPC.
Thanks for the response Peter. I have looked in the demo (usually my first try - always open on my PC when I'm coding) but I guess if you say it's in there then I haven't looked hard enough. I'll have another look, thanks.
I've had a look through and done some more googling / python doco / soul searching etc. and I'm still having a problem. Can anyone tell me why the following doesn't work?
def downloadVid(self, e):
thread.start_new_thread(self.bgDownloadProc, ())
while self.lockDL.locked():
self.gagProgress.Pulse()
sleep(1)
Not sure if this will work with what you are doing but it might help to use a timer for pulsing the gauge, then you wont be calling sleep on the main thread and there will be no need for the lock that is giving the error you mentioned below.
It just tells me that I'm trying to release a lock that's already been released. All I want is for the progress bar to pulse while the file is downloading then stop at the end.
Regards,
Wayne
---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org
I've had a look through and done some more googling / python doco / soul searching etc. and I'm still having a problem. Can anyone tell me why the following doesn't work?
def downloadVid(self, e):
thread.start_new_thread(self.bgDownloadProc, ())
while self.lockDL.locked():
self.gagProgress.Pulse()
sleep(1)
Not sure if this will work with what you are doing but it might help to use a timer for pulsing the gauge, then you wont be calling sleep on the main thread and there will be no need for the lock that is giving the error you mentioned below.