Open rainit2006 opened 7 years ago
os.path.join : path结合
os.path.join(direcotry, subDirecotry)
os.path.listdir: 取得子目录一览
os.path.getsize(file) 取得文件大小
取得目录大小:需要自己实现
def get_size(start_path):
totoal_size = 0
for dirpath, dirnames, filenames in os.walk(start_path):
for f in filenames:
fs = os.path.join(dirpath, f)
totoal_size += os.path.getsize(fs)
return totoal_size
Excel操作
xlrd, xlwx library are not able to delete rows/columns.
总结的不错: http://www.yoheim.net/blog.php?q=20170304