WebLinuxStudy

导航

 

2019年12月5日

摘要: os.access(file, mode)判断文件的访问权限file为文件mode为操作模式,有这么几种:os.F_OK: 检查文件是否存在;os.R_OK: 检查文件是否可读;os.W_OK: 检查文件是否可以写入;os.X_OK: 检查文件是否可以执行; 阅读全文
posted @ 2019-12-05 21:49 WebLinuxStudy 阅读(1236) 评论(0) 推荐(0) 编辑
 
摘要: 1.os.path.exists()既可以判断文件是否存在,又可以判断文件夹是否存在 2.os.path.isfile()判断文件是否存在 3.os.path.isdir()判断文件夹是否存在 阅读全文
posted @ 2019-12-05 21:48 WebLinuxStudy 阅读(2452) 评论(0) 推荐(0) 编辑