using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace 进制转换 { class Program { #region 直接删除指定目录下的所有文件及文件夹(保留目录) /// <summary> ///直接删除指定目录下的所有文件及文件夹(保留目录) /// </summary> ///
编写了一个遍历一个目录下所有的文件及文件夹,然后计算每个文件的字符和line的小程序,先把程序贴出来. #coding=utf-8 ''' Created on 2014年7月14日 @author: Administrator ''' import os import os.path rootdir =r'c:\python27\jiaoben' filefullnames=[] def traverse(rootdir,filefullnames): for parent,dirnames,
如何查看windows某个目录下所有文件/文件夹的大小? https://www.cnblogs.com/gered/p/10208281.html 挺好的工具 linux 上面 我就是使用 du -ah --max-depth= 来查看了 windows 有这么一个好用的工具也挺好呢. 如何查看windows某个目录下所有文件/文件夹的大小? TreeSize Free绿色汉化版是一款硬盘空间管理工具,用树形描述出来,能够显示文件大小和实际占用空间数及浪费的空间等信息,让你做出相应的删除决
#自定义函数: import ospath="D:\\Temp_del\\a"def gci (path): """this is a statement""" parents = os.listdir(path) for parent in parents: child = os.path.join(path,parent) #print(child) if os.path.isdir(child): gci(child)