早睡早起,方能养生
Sleep early rise early, way to keep healthy

Python判断文件是否存在 os 基础用法

super
2022-12-15 00:03
views 1231

Python判断文件是否存在 os 基础用法

 

import os

exist = os.path.exists('py017.jpeg')
print(exist)
# True


exist = os.path.exists('py666.jpeg')
print(exist)
# False

 



分享
0 条讨论
top