【练习】用python写一个计算文件夹总大小的程序
2021-04-26 19:28
阅读:526
标签:for lis list 大小 get imp filename pytho 程序 【练习】用python写一个计算文件夹总大小的程序 标签:for lis list 大小 get imp filename pytho 程序 原文地址:https://www.cnblogs.com/uuuuuuuuuuuuuuuu/p/13251441.htmlimport ossize=0filename=‘输入你的文件夹绝对路径‘for g in os.walk(filename):path, dir_list, name_list=gfor name in name_list:abs_path=os.path.join(path,name)size+=os.path.getsize(abs_path)print(‘文件总大小:%s‘%size)
评论
亲,登录后才可以留言!