FTP win32 program
Acid
none at nospam.net
Mon Jul 23 21:40:13 EDT 2001
I am trying to write simple program with Python to connect to an ftp,
list, download a file(s) etc...
I am running this under Win2K professional with Python 2.1:
from ftplib import FTP
ftp = FTP('ftp.techlogik.com,user,password') # connect to host
ftp.cwd('cd/misc') #
change directory
ftp.retrlines('LIST') #
list /misc
ftp.quit()
I start the Python Gui, then New Window, put the above script in, then
save, then Run Script. It returns:
File "C:/Python21/download.py", line 2
from ftplib import FTP
^
SyntaxError: invalid syntax
What's the trick to get this working under Win32?
Thanks,
Keith
More information about the Python-list
mailing list