[Tutor] ftplib.storbinary and using a progress bar

Kent Johnson kent37 at tds.net
Sun Sep 7 13:06:09 CEST 2008


On Sun, Sep 7, 2008 at 4:13 AM, Alan Gauld <alan.gauld at btinternet.com> wrote:
> "johnf" <jfabiani at yolo.com> wrote
>
>> the file transfer (it could be a very long transfer).  But
>> ftplib.storbinary() has no callback like retrbinary() so does anyone have
>> a
>> thought on how I can update my user on the progress of the transfer.
>
> If you don't fancy getting the 2.6 source as Terry suggested then
> the other way to do this kind of thing is with a separate thread. Start
> the new thread which just displays a progress bar (you need to find
> how big the file is before hand and check progress as you go too)
> Then in the main thread run the transfer and terminate the progress
> thread when you finish.

I don't think threading will help here, the problem is that the
progress information is not available.

Kent


More information about the Tutor mailing list