比如你只需要提取文件中的手机号,而这些文件的编码都不相同,这时,可以这样:

f = open(filename,'r,encoding='utf-8',errors='ignore')

content = f.read()

#do something with content

f.close()

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-07-05
  • 2022-01-08
  • 2021-11-01
  • 2021-09-18
  • 2021-11-05
  • 2022-12-23
猜你喜欢
  • 2022-01-21
  • 2022-01-17
  • 2021-04-12
  • 2021-09-11
  • 2021-12-30
  • 2021-07-17
  • 2022-12-23
相关资源
相似解决方案