1 with open('shell','r+') as f:
2     for index,i in enumerate(f):
3         print(index,i.strip())  #Python strip() 方法用于移除字符串头尾指定的字符(默认为空格)。

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-12-18
  • 2022-12-23
  • 2021-12-20
  • 2022-01-20
  • 2021-12-15
  • 2022-02-06
猜你喜欢
  • 2022-12-23
  • 2022-01-04
  • 2021-05-16
  • 2021-12-07
  • 2021-10-29
  • 2021-10-23
相关资源
相似解决方案