bamanzi 发表于 2013-1-15 02:52:06

Python小脚本: 转换DownThemAll下载的文件名中的%E7等字符

# normalize filename of file downloaded by DownThemAll# convert 'extjs%E7%94%B5%E5%AD%90%E6%95%99%E7%A8%8B' to 'extjs电子教程'# only tested on Windows XPfrom glob import globimport urllib2import osfor fn in glob('*%*'):    newfn = urllib2.unquote(fn).decode('utf-8')    print "%s => %s" % (fn, newfn)    os.rename(fn, newfn)
页: [1]
查看完整版本: Python小脚本: 转换DownThemAll下载的文件名中的%E7等字符