import os
os.path.isfile('test.txt') # 如果不存在就返回False
os.path.exists(directory) # 如果目录不存在就返回False
os.makedirs(targetDir)
os.path.join(targetDir, file)os.remove(targetFile)
微信扫一扫
import os
os.path.isfile('test.txt') # 如果不存在就返回False
os.path.exists(directory) # 如果目录不存在就返回False
os.makedirs(targetDir)
os.path.join(targetDir, file)os.remove(targetFile)
相关推荐