ftp download in multithread and wxpython?

ROY ZINN wrote:

Hi All,

I'm trying to implement multi thread to handle the ftp connection and
download.
it looks as if from within the gui it's impossible.

can i use the ftp connection only with the main thread (the GUI) ?

Thanks,
Roy.

Hi Roy,
Your question isn't very detailed, I didn't quite understand your
problem. Specifically, why do you say that "it looks as if from within
the gui it's impossible"?

You certainly can connect to FTP using Python's ftplib or any other
FTP client library. This has nothing to do with the GUI. So I'm
guessing your problem is actually thread-related and not about FTP.

Only the main thread can handle the wxPython GUI, that's true. But it
can also do anything else, including FTP. However, if you want to have
a separate thread to handle the FTP stuff, you'll have to use some
mechanism where the main thread updates the GUI and handles events,
and the other threads pass anything GUI related through the main
thread.

Or perhaps your FTP library uses threads internally, and that is
causing problems... (doubtful)

Threading issues have been discussed a lot on this mailing list and
others, a search (on Google Groups or gmane) should raise a lot of
relevant conversations.

- Tal