![]() |
2011-02-28
, 18:03
|
|
Posts: 186 |
Thanked: 192 times |
Joined on Jan 2010
@ Finland
|
#2
|
![]() |
2011-02-28
, 18:13
|
|
Posts: 1,684 |
Thanked: 1,562 times |
Joined on Jun 2008
@ Austin, TX
|
#3
|
![]() |
2011-02-28
, 19:24
|
Posts: 146 |
Thanked: 15 times |
Joined on Oct 2008
|
#4
|
![]() |
2011-02-28
, 20:10
|
|
Posts: 1,684 |
Thanked: 1,562 times |
Joined on Jun 2008
@ Austin, TX
|
#5
|
@ epage and juise:
Sorry, I should have been more clear. I don't want anything too complicated. I just want my app not to get blocked while it downloads some specific files from the internet, since those files are not used by the program itself.
Will take a look on threads.
Thanks!
L.
![]() |
2011-02-28
, 21:28
|
Posts: 146 |
Thanked: 15 times |
Joined on Oct 2008
|
#6
|
You say app, which implies GUI (rather than script). This adds complication because you have to notify the UI thread that data is available. I have code to simplify this for both Qt and GTK. Interested?
![]() |
2011-02-28
, 21:33
|
Posts: 235 |
Thanked: 339 times |
Joined on Nov 2010
|
#7
|
![]() |
2011-02-28
, 21:34
|
Posts: 376 |
Thanked: 511 times |
Joined on Aug 2009
@ Greece
|
#8
|
Hi folks,
I know, not really the place to post this, but you've been quite helpful before, so.... sorry.
I want to do a task in python in a way that does not block the program. For example, downloading files from the internet.
![]() |
2011-02-28
, 22:03
|
|
Posts: 1,684 |
Thanked: 1,562 times |
Joined on Jun 2008
@ Austin, TX
|
#9
|
![]() |
2011-03-01
, 02:16
|
Posts: 146 |
Thanked: 15 times |
Joined on Oct 2008
|
#10
|
http://www.pygtk.org/pygtk2reference...t--spawn-async
I know, not really the place to post this, but you've been quite helpful before, so.... sorry.
I want to do a task in python in a way that does not block the program. For example, downloading files from the internet.
Of course I could do a separate program and call a subprocess, or do somethink like "os.popen('wget .... &')". But I want to do this inside the main program, in pure python.
Which is the best way to do this? Can you point me to some reading?
Thanks!!
Cheers,
L.