摘要: #!/usr/bin/env python3 # -*- coding: utf-8 -*- #列出当前目录下文件的大小和创建日期及文件名,相当于ls -l命令 from datetime import datetime import os pwd = os.path.abspath('.') print(' Size Last Modified Name') prin... 阅读全文
posted @ 2017-11-22 17:43 hayden__wang 阅读(199) 评论(0) 推荐(0) 编辑
摘要: #!/usr/bin/env python3 """检测一个文件的访问模式 """ import os print('Testing:', __file__) #显示输出的文件名 print('Exists:', os.access(__file__, os.F_OK)) #判断一个文件是否存在 print('Readable:', os.access(__file__, os.R_OK))... 阅读全文
posted @ 2017-11-22 14:58 hayden__wang 阅读(182) 评论(0) 推荐(0) 编辑