Python判断文件是否存在 os 基础用法
super
2022-12-15 00:03
![views](/static/super/images/icon/evaluate-9a.png)
Python判断文件是否存在 os 基础用法
import os
exist = os.path.exists('py017.jpeg')
print(exist)
# True
exist = os.path.exists('py666.jpeg')
print(exist)
# False
![](/uploads/article/20221215/f434b87427514cf9fe39cc25bdbca80b.png)
0 条讨论