[EMAIL PROTECTED] wrote:
> I'm trying to write a backup script to put files on a server.
>
> --This is how I have begun:
>
>
> from ftplib import FTP
>
> f = open(r'g:\dev\python\exercises\aaa.py', 'r')
> fname = r'g:\dev\python\exercises\aaa.py'
>
> ftp = FTP('ftp.xxxx.com <http://ftp.xxxx.com>')
> ftp.login()
>
> ftp.storlines ('STOR ' + fname, f)
fname should be just a bare name, e.g. 'aaa.py'. You have to ftp.cwd()
to the correct directory yourself.
Here is a module I use for ftp upload, it has a nicer API than the bare
ftplib:
http://www.nedbatchelder.com/code/modules/ftpupload.html
Kent
_______________________________________________
Tutor maillist - [email protected]
http://mail.python.org/mailman/listinfo/tutor