文件操作
fr = open('plainText.txt',mode='r',encoding='utf-8') plainText = fr.read() print('明文:'+plainText) print('密文:',end='' ) fw = open('cipherText.txt',mode='a',encoding='utf-8') for c in plainText: print(chr(ord(c)+2),end='') fw.write(chr(ord(c)+2))