(no subject)

Alex Martelli alex at magenta.com
Wed Aug 16 16:57:53 EDT 2000


"mang wang" <banwong at hotmail.com> wrote in message
news:F168ZpEVmkWFBXZGYmX00000d67 at hotmail.com...
> Hi:
>   Is there any function call or module I can use to find out the capacity
of
> my C drive in Python Script?

Here's one way out of many, perhaps the simplest -- instantiate the
COM object of progid Scripting.FileSystemObject and get a Drive object:

fso = win32com.client.Dispatch("Scripting.FileSystemObject")
drv = fso.GetDrive('C:')

print 'Total Bytes:',drv.TotalSize
print 'Avail Bytes:',drv.AvailableSpace


Alex





More information about the Python-list mailing list