An FTP Client...My first real program!

s0suk3 at gmail.com s0suk3 at gmail.com
Wed Aug 13 21:30:18 EDT 2008


On Aug 13, 2:27 pm, tmallen <thomasmallen at gmail.com> wrote:
> Here's the code:http://pastebin.com/m21dfcc19
>
> What could be improved? The script feels clumsy, and I have no
> experience refactoring Python code. This will eventually be a GUI FTP
> client. I'm mainly looking for design advice...

Well of course it could be improved, so far you've got less than 50
lines :). You're on the starting-from-scratch phase.

Here's my advice: Since you're a beginner (basing on the title of the
thread), and are probably doing this for educational purposes, I'd
recommend you not to use the ftplib module. Doing Internet protocol
implementations is lots of fun. But with Python, which has modules for
most of the popular protocols, you'll probably never need to do
anything like this manually. Most Internet protocols are defined by
some sort of standard, usually an RFC. FTP's is RFC 959 (http://
www.ietf.org/rfc/rfc0959.txt). (This recommendation is of course
directed to you in particular; in production code it would be
generally better to use the ftplib module.)

Sebastian




More information about the Python-list mailing list