"""算法导论--输入输出藏文字符 Author:Kerhy""" def write_str(): for i in range(0x0f00,0x0fff): with open('./utibet.txt','a+',encoding='utf-8') as fp: fp.write(chr(i)+'\n') write_str() #写入的时候调用 #读取文件输出到控制台: def read_str(): with open('./utibet.txt','r',encoding='utf-8') as fp: print(fp.read()) read_str()