文件操作,列表实例NiceHexSpiral

fr = open('88.txt',mode='r', encoding='utf-8')
planincode = fr.read()
print('明文:' + planincode)

print('密文:',end='')
for c in planincode:
    print(chr(ord(c)+3),end='')

fr = open('88.txt',mode='r',encoding='utf-8')
plaincode = fr.read()
fr.close()

fw = open('c_88.txt',mode='a', encoding='utf-8')
for c  in  plaincode:
    fw.write(chr(ord(c)-3))
fw.close()

fr = open('88.txt',mode='r',encoding='utf-8')
plaincode = fr.read()
fr.close()

fw = open('c_88.txt',mode='a', encoding='utf-8')
for c  in  plaincode:
    fw.write(chr(ord(c)-3))
fw.close()

你可能感兴趣的:(文件操作,列表实例NiceHexSpiral)