download ftp file in python
2008-09-12 09:09:35 Category:Python Comments:0 Reference:0 Tags: python , ftp
def run():
ftpObj=ftplib.FTP('10.10.xx.xxx','aaa','aaa')
print ftpObj.cwd('user_projects/domains/web/myserver/')
files=FtpFiles()
print ftpObj.retrlines('nlst access.log',files.analyFile)
ftpObj.retrbinary('RETR access.log',open('access.log','wb').write)
print ftpObj.quit()
class FtpFiles:
files=[]
def analyFile(self,aLine):
##do something
Recent Comments:
qsJpYHO:Hi! MyzbhyCz
huyapD:Hi! IFEMzLa
Pharme908:Very nice site!
jumang:忘记说了,他发送这个短信时使用电话号码是135233743006。
Pharmd560:Very nice site!