python定义一个类实例作为ftp回调方法,python回调,class Writer
python定义一个类实例作为ftp回调方法,python回调,class Writer
class Writer: def __init__(self, file): self.f = open(file, "w") def __call__(self, data): self.f.write(data) self.f.write('\n') print dataFILENAME = "AutoIndent.py"writer = Writer(FILENAME)import ftplibftp = ftplib.FTP('127.0.0.1', 'book', 'bookpw')ftp.retrlines("RETR %s" % FILENAME, writer)
相关内容
- python通过Tkinter显示网络图片,,''' tk_image
- 通过python内置的timeit模块计算代码执行时间,pythontim
- Evaluate X and Y returned from the differential equation solvers usin
- python自动给数字前面补0的方法,python数字补0,python中有
- python将两个数组合并成一个数组的两种方法,python数组
- python获取当前时间的unix时间戳,pythonunix, import date
- python快速入门教程,python入门教程,假设我们有这么一项
- python编写的简单温度转换程序,python编写转换程序,60
- python通过PyGame模块播放声音,pythonpygame,import pygam
- webpy获得http请求头信息,webpy获得请求头,webpy中可以通
评论关闭