views:

124

answers:

3

i need a simple implementation of ftp that i can setup quickly for some experiments. is there an equivalent of python -m SimpleHTTPServer for ftp. Google sarch didn't help. i just need a simple implentation of ftp that is easy to setup. (so i don't have to go through the installation trouble for a lot of PC's).

+1  A: 

Try pyftpdlib project, seems well-documented, pretty active and straightforward to me.

from pyftpdlib import ftpserver
authorizer = ftpserver.DummyAuthorizer()
authorizer.add_user("user", "12345", "/home/user", perm="elradfmw")
authorizer.add_anonymous("/home/nobody")
handler = ftpserver.FTPHandler
handler.authorizer = authorizer
address = ("127.0.0.1", 21)
ftpd = ftpserver.FTPServer(address, handler)
ftpd.serve_forever()
systempuntoout
A: 

I use pyftplib too, its pretty useful. It would be also good to note that the literary is only one single file.

GuySoft
+1  A: 

I would say pyftpdlib fits your needs. =) Also, starting from the next version, there will be a command line parser to quickly configure the FTP server when run with python's -m option, in case you don't want to put hands on the code.

Giampaolo Rodolà