Discuss / Python / 注意路径和编码(utf-8可展示字母、数字、中文以及特殊字符)

注意路径和编码(utf-8可展示字母、数字、中文以及特殊字符)

Topic source

#1 Created at ... [Delete] [Delete and Lock User]
fpath = '111.txt'#errors='ignore'with open(fpath, 'r', encoding='utf-8') as f:    s = f.read()    print(s)

  • 1

Reply