Any python scripts to do parallel downloading?

Jean-Paul Calderone exarkun at divmod.com
Thu Feb 1 07:43:20 EST 2007


On 31 Jan 2007 22:02:36 -0800, Michele Simionato <michele.simionato at gmail.com> wrote:
>On Jan 31, 8:31 pm, "Carl J. Van Arsdall" <cvanarsd... at mvista.com>
>wrote:
>>
>> Well, since it will be io based, why not use threads?  They are easy to
>> use and it would do the job just fine.  Then leverage some other
>> technology on top of that.
>>
>> You could go as far as using wget via os.system() in a thread, if the
>> app is simple enough.
>
>Calling os.system in a thread look really perverse to me, you would
>loose CTRL-C without any benefit.
>Why not to use subprocess.Popen instead?
>
>I am unhappy with the current situation in Python. Whereas for most
>things Python is such that the simplest
>things look simple, this is not the case for threads. Unfortunately we
>have a threading module in the
>standard library, but not a "Twisted for pedestrian" module, so people
>overlook the simplest solution
>in favor of the complex one.
>Another thing I miss is a facility to run an iterator in the Tkinter
>mainloop: since Tkinter is not thread-safe,
>writing a multiple-download progress bar in Tkinter using threads is
>definitely less obvious than running
>an iterator in the main loop, as I discovered the hard way. Writing a
>facility to run iterators in Twisted
>is a three-liner, but it is not already there, nor standard :-(
>

Have you seen the recently introduced twisted.internet.task.coiterate()?
It sounds like it might be what you're after.

Jean-Paul



More information about the Python-list mailing list