ftp get from a Tkinter gui: advice wanted

John J. Lee jjl at pobox.com
Sat Aug 16 00:36:55 CEST 2003


"Russell E. Owen" <rowen at cesmail.net> writes:

> I'm writing a Tkinter app (telescope remote controller). The application 
> presently runs on unix and MacOS X and I think some users will want to 
> use Windows. It's going just fine, but I'm trying to add the ability to 
> automatically get images via binary ftp (i.e. as each image is recorded) 
> and am realizing it's harder than I though.
> 
> Ideally, I'd like image download to work like a typical web browser 
> download: a status window that shows each transfer, how far along it is, 
> allows the user to cancel it, etc.
[...]

Not sure what "as each image is recorded" refers to, but if you want
to grab files via ftp, is there anything wrong with (in a separate
thread, I suppose):

import urllib2
urllib2.urlopen("ftp://ftp.example.com/pub/rhubarb.txt")

?

At a lower level, there's ftplib of course.

If you don't mind pulling in more code, no doubt Twisted could do this
just as simply too, and, I imagine, wouldn't need to use a separate
thread (never used it, but I know it has support for various common
GUI event loops).


John




More information about the Python-list mailing list