摘要: 1.查找文件 import os keyword = ".mp4" size = 100 * 1024 * 1024 #字节 start_dir = "/" for cur_path,dirs,files in os.walk(start_dir): # print("当前查找的目录是%s" % c 阅读全文
posted @ 2021-01-17 22:15 chenghuahua 阅读(77) 评论(0) 推荐(0)
摘要: 一、os import os result = os.system("cd ..") #执行操作系统命令 #返回0,代表命令执行成功,返回其他的代表执行不成功,拿不到命令执行的实际结果 print(result) result = os.popen("cd ..").read() #可以拿到命令返回 阅读全文
posted @ 2021-01-17 16:36 chenghuahua 阅读(65) 评论(0) 推荐(0)
摘要: 模块就是一个python文件 一.分为3种类型 1、标准模块 python自带的:random、datetime、string、json 2、第三方模块 3、自己写的模块 自己写的模块中,若有部分代码不想让别人导入,则可以使用if __name__ == '__main__': 将不想让别人导入的代 阅读全文
posted @ 2021-01-17 16:29 chenghuahua 阅读(280) 评论(0) 推荐(0)