import os
os.path.isfile('test.txt')  # 如果不存在就返回False
os.path.exists(directory)  # 如果目录不存在就返回False

 

os.makedirs(targetDir)  
os.path.join(targetDir, file)
os.remove(targetFile)

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-26
  • 2021-10-02
猜你喜欢
  • 2021-08-27
  • 2021-10-25
  • 2022-12-23
  • 2021-06-30
  • 2022-01-17
  • 2022-02-28
相关资源
相似解决方案