语言:python3
功能:获取指定目录下各目录占用的空间大小
// 获取指定目录下各目录占用的空间
# -*- coding: utf-8 -*-
import os,time,platform,sys
from threading import Thread
path,file='./',1
sys0=platform.system()
if sys0=="Linux":
a=1
elif sys0 == "Windows":
a=2
else:
a=0
print("系统不是windows或linux")
忽略目录=["opt"]
global end,log1ist
end,log1ist=1,[]
def write():
global end, log1ist
while end:
time.sleep(1)
m=len(log1ist)
if m:
with open(filepath,'a+'