上一页 1 ··· 26 27 28 29 30 31 32 33 34 ··· 38 下一页
摘要: #如果存在以下树结构: | ---- a.txt | ----picturc | -- folder1 ----| -----folder_1 -----| ------ entertainmentG:----test ----- | --- folder2 ---music.mp3 | ---- ... 阅读全文
posted @ 2013-05-21 17:11 前行者2011 阅读(186) 评论(0) 推荐(0) 编辑
摘要: #目前只能删除文件,删除空目录未完成(红色部分)import os#os.chdir('G:\2013-05-21')def getfile(dir_path): #print dir_path if os.path.exists(dir_path): path_list = getlist(dir... 阅读全文
posted @ 2013-05-21 15:49 前行者2011 阅读(194) 评论(0) 推荐(0) 编辑
摘要: 最近在写的程序频繁地与文件操作打交道,这块比较弱,还好在百度上找到一篇不错的文章,这是原文传送门,我对原文稍做了些改动。有关文件夹与文件的查找,删除等功能 在os模块中实现。使用时需先导入这个模块,导入的方法是:import os一、取得当前目录s =os.getcwd()# s 中保存的是当前目录... 阅读全文
posted @ 2013-05-21 15:33 前行者2011 阅读(125) 评论(0) 推荐(0) 编辑
摘要: import globimport osbase=r'E:\*'tag=['.mp3']def getMp3(name,label): dir_file=[m for m in glob.glob(name) if m!='E:\\$RECYCLE.BIN' and m!='E:\\System V... 阅读全文
posted @ 2013-05-15 15:40 前行者2011 阅读(144) 评论(0) 推荐(0) 编辑
摘要: #变量E盘下的mp3文件,输出mp3文件的路径import osbase=r'E:\\'tag=['.txt'] def getmp3(root,label): base_list = [os.path.normcase(i) for i in os.listdir(root) if i !='Sy... 阅读全文
posted @ 2013-05-14 18:27 前行者2011 阅读(119) 评论(0) 推荐(0) 编辑
摘要: #coding:utf-8import threadingimport osimport timedef main(name,*types): for root,dirs,files in os.walk(name): for f in files: if ... 阅读全文
posted @ 2013-05-14 16:06 前行者2011 阅读(156) 评论(0) 推荐(0) 编辑
摘要: while True: try: m=input('Please input first namuber:') n=input('Please input second namuber:') res= m/n #多个异常,建议此处使用Exception e;使用e打印详细异常信息 except (... 阅读全文
posted @ 2013-05-14 13:35 前行者2011 阅读(117) 评论(0) 推荐(0) 编辑
摘要: #coding:utf-8import osdirname = 'D:\\'li=[f for f in os.listdir(dirname)]print lifor f in li: if os.path.isfile(os.path.join(dirname,f)): print os.pat... 阅读全文
posted @ 2013-05-13 18:01 前行者2011 阅读(73) 评论(0) 推荐(0) 编辑
摘要: 在window下设置环境变量====================================================================================右击我的电脑--->属性--->高级--->环境变量--->系统变量(最好还是在系统变量中建,这样所有用... 阅读全文
posted @ 2013-05-13 13:52 前行者2011 阅读(103) 评论(0) 推荐(0) 编辑
摘要: 此教程针对初学者,尽量避免因为环境问题导致的运行问题。如有问题,请入群247870083讨论,本次安装所需软件,亦会在群共享(RF环境准备.rar)。本机环境win8 64位虚拟机,只有1个盘,同志们安装请移到其他盘。由于安装软件较多且运行系统单一,尽量每次安装好后都验证一下。下载链接没时间去一个个... 阅读全文
posted @ 2013-05-13 10:38 前行者2011 阅读(111) 评论(0) 推荐(0) 编辑
上一页 1 ··· 26 27 28 29 30 31 32 33 34 ··· 38 下一页