python 通过urllib模块在svn中下载文件,urllibsvn,#_*_coding


#_*_coding:utf-8_*_

import urllib

def Schedule(a,b,c):
‘‘‘
a:已经下载的数据块
b:数据块的大小
c:远程文件的大小
‘‘‘
per = 100.0 * a * b / c
if per > 100:
per = 100
print "%.2f%%"% per

f=file(‘a.txt‘)#文件路径保存
for i in f.readlines():
c=i.strip().split(‘/‘)
b=‘/Python27/a/%s‘%‘‘.join(c[-1:])
i=i.decode("gb2312").encode(‘utf-8‘)#读取文本中内容后转码
urllib.urlretrieve(i,b,Schedule)

python 通过urllib模块在svn中下载文件

相关内容

    暂无相关文章

评论关闭