Checking free disk space on Win32 ?

Méta-MCI enleverlesX.XmcX at XmclaveauX.com
Sat Jan 28 16:03:41 CET 2006


Hi !


Another method :

    import os
    print str(os.popen4('dir C:\ /AD |find "octets"|find 
"libre"')[1].readlines()[0].split()[2])

Warning !  It's French version.
For english, perhaps (depend of DIR return format) :

    import os
    print str(os.popen4('dir C:\ /AD |find "bytes"|find 
"free"')[1].readlines()[0].split()[2])


@-salutations

Michel Claveau






More information about the Python-list mailing list