ftplib question

Olivier Dagenais olivierS.dagenaisP at canadaA.comM
Wed Oct 18 12:44:10 EDT 2000


I might be able to help you, as I have recently used it to create the
attached script that helps me to send backups of my work to an FTP server.
Take a look at my code, although it sends a file it should provide you with
an example.  I found the documentation quite adequate for the module.

If you still have some trouble, post the part of code that's causing you
problems, along with a traceback or description of the error.

--
----------------------------------------------------------------------
Olivier A. Dagenais - Software Architect and Developer
"Someone called 'Type your name here' is impersonating me on the
internet and is posting exactly the same things I am posting!"


<jb4mt at my-deja.com> wrote in message news:8skgto$j$1 at nnrp1.deja.com...
> How do I use ftplib to download a text file?  My script works fine as
> far as logging in and navigating to the proper directory.  I just can't
> figure out how to use the various objects, such as retrlines().  I'm
> not able to pass 'get whatever.file' to this object, but that is the
> command I'd issue at the command prompt when using FTP.  I've looked at
> the documentation but can't easily figure it out.  Help from anybody
> with previous experience would be very much appreciated.
>
> Thanks
>
> George
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.


begin 666 ftpto.py
M9G)O;2!F='!L:6(@:6UP;W)T($944 T*:6UP;W)T('-Y<RP@;W,-"@T*9&5F
M($944'1O("@@<V]U<F-E1FEL92P at 9&5S=%-I=&4L(&1E<W1$:7(L('5S97(@
M/2 G)RP@<&%S<W=O<F0@/2 G)R I. at T*"7!R:6YT(")#;VYN96-T:6YG+BXN
M(@T*"69T<" ]($944" H(&1E<W13:71E+"!U<V5R+"!P87-S=V]R9" I#0H)
M<')I;G0@(D-H86YG:6YG('1O("<E<R<N+BXB("4 at 9&5S=$1I<@T*"69T<"YC
M=V0@*"!D97-T1&ER("D-"@EP<FEN=" B1&5L971I;F<@97AI<W1I;F<@9FEL
M92!O;B!S97)V97(N+BXB#0H)=')Y. at T*"0EF=' N9&5L971E("@@<V]U<F-E
M1FEL92 I#0H)97AC97!T. at T*"0EP87-S#0H)<')I;G0@(D]P96YI;F<@<V]U
M<F-E(&9I;&4@)R5S)RXN+B(@)2!S;W5R8V5&:6QE#0H):%-O=7)C92 ](&]P
M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H`
`
end




More information about the Python-list mailing list