Find free disk space in python on OS/X

后端 未结 7 1137
死守一世寂寞
死守一世寂寞 2020-12-08 07:51

I\'m looking for the number of free bytes on my HD, but have trouble doing so on python.

I\'ve tried the following:

import os

stat = os.statvfs(path         


        
相关标签:
7条回答
  • 2020-12-08 08:24

    What's wrong with

    import subprocess
    proc= subprocess.Popen( "df", stdout=subprocess.PIPE )
    proc.stdout.read()
    proc.wait()
    
    0 讨论(0)
提交回复
热议问题