1、读

1 f = read('$filePath', 'r')
2 line = f.readline()    #读取一行
3 lines = f.readlines() #读取所有行

2、写

1 with open('$filePath', 'w') as fw:
2     fw.write(sth)

 

相关文章:

  • 2021-10-28
  • 2021-07-19
  • 2021-10-31
  • 2021-08-11
  • 2021-09-23
猜你喜欢
  • 2022-01-12
  • 2022-12-23
  • 2021-09-07
  • 2021-06-07
  • 2021-11-04
  • 2021-09-16
相关资源
相似解决方案