fpath = r'test.txt' with open(fpath, 'x', encoding = 'utf-8') as f: f.write('yang们') with open(fpath, 'r', encoding = 'utf-8') as f: s = f.read() print(s)
Sign in to make a reply
梦想家高先森