序列化 有问题
! coding:utf-8
import pickle
以二进制形式读取文件内容
original = "banner.p"
destination = "banner_unix.p"
content = ''
outsize = 0
with open(original, 'rb') as infile:
content = infile.read()
with open(destination, 'wb') as output:
for line in content.splitlines():
outsize += len(line) + 1
output.write(line + str.encode('\n'))
data = pickle.load(open('banner.p', 'rb'))
data = pickle.load(open(destination, 'rb'))
for each in data:
# print(each)
print("".join([i[1] * i[0] for i in each]))