uu 编码体系用于将任意二进制数据转换为普通文本格式.
1 __author__ = 'Zechary' 2 import uu 3 import os, sys 4 infile = 'D:/Python/fish.jpg' 5 uu.encode(infile, sys.stdout, os.path.basename(infile))
把文件转换为二进制
数据还原
1 __author__ = 'Zechary' 2 import uu 3 import os, sys 4 outfile = 'D:/Python/abc.jpg' 5 infile ='D:/Python/fish.uue' 6 uu.decode(infile, outfile)