摘要:
这里介绍三种判断文件或文件夹是否存在的方法,分别使用os模块、Try语句、pathlib模块。 1.使用os模块 os模块中的os.path.exists()方法用于检验文件是否存在。 import os os.path.exists(test_file.txt) #True os.path.exi 阅读全文
posted @ 2021-01-04 16:30
py小马冲冲冲
阅读(532)
评论(0)
推荐(0)
浙公网安备 33010602011771号