问题描述
我想将我的 python 文件 的输出导出到 microsoft access >,我尝试了几种方法,但还是无法弄清楚。
import os
def getFolderSize(folder):
total_size = os.path.getsize(folder)
try:
for item in os.listdir(folder):
itempath = os.path.join(folder,item)
if os.path.isdir(itempath):
total_size += getFolderSize(itempath)
elif os.path.isfile(itempath):
total_size += os.path.getsize(itempath)
except Exception:
print("ex")
return total_size
a=os.listdir("D:\\")
for folder in a:
if os.path.isdir("D:\\"+folder):
print("Folder name: ",folder," size: ",getFolderSize("D:\\"+folder)/(1024*1024*1024),"gb")
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)