Thanks Tim,
I only need to run the get hard drive space function on one drive for
one machine so I'll stick to GetDiskFreeSpace. If I need to expand
this feature to multiple harddrives/machines, I'll be sure to come
back to this thread. :)
Kevin
On Mar 1, 4:17 am, Tim Golden <[EMAIL PROTECTED]>
[EMAIL PROTECTED] wrote:
> HI,
>
> I am new to Python and wanted to know how to check for the remaining
> disk space on my Windows machine using Python? I was thinking of using
> the command line "dir" and trying to extract the output from there.
> But I'm not sure how to extract command line stri
En Wed, 28 Feb 2007 18:54:53 -0300, kevinliu23 <[EMAIL PROTECTED]>
escribió:
> It's great because I don't even have to worry about the computer name.
> A question regarding the rootPath parameter...how would I be passing
> it? Would I be passing it as...
>
>tuple = win32api.GetDiskFreeSpace(
kevinliu23 wrote:
> Just tried your solution Tim, worked like a charm. :)
>
> It's great because I don't even have to worry about the computer name.
> A question regarding the rootPath parameter...how would I be passing
> it? Would I be passing it as...
>
>tuple = win32api.GetDiskFreeSpace(r'
H, right now...I'm doing multiplication on the index values
returned by GetDiskFreeSpace. According to the documentation...
tuple[0]: sectors per cluster
tuple[1]: number of bytes per sector
tuple[2]: total number of free clusters
tuple[3]: total number of clusters on the disk
So I'm multiply
On 2/28/07, Tim Golden <[EMAIL PROTECTED]> wrote:
> Well it's not often someone beats me to a WMI
> solution :) Just to be different, you can also
> look at the GetDiskFreeSpace function in the
> win32api module of the pywin32 extensions.
The MSDN page for that function warns:
"The GetDiskFreeSpac
kevinliu23 wrote:
> Thanks so much for the help guys. I got the code Sick Monkey provided
> to work on my computer. Now I"m more confused than ever though. :) I
> thought the only standard modules provided by Python are listed here:
>
> http://docs.python.org/modindex.html
>
> But it appears that
Just tried your solution Tim, worked like a charm. :)
It's great because I don't even have to worry about the computer name.
A question regarding the rootPath parameter...how would I be passing
it? Would I be passing it as...
tuple = win32api.GetDiskFreeSpace(r'C:')
or just leave it blank and
Thanks so much for the help guys. I got the code Sick Monkey provided
to work on my computer. Now I"m more confused than ever though. :) I
thought the only standard modules provided by Python are listed here:
http://docs.python.org/modindex.html
But it appears that there are other modules availab
[... re getting free disk space ...]
Sick Monkey wrote:
> Here you are:
>
> >>> from win32com.client import GetObject
wmiObj = GetObject("winmgmts:MGW01641\\root\\cimv2")
diskinfo = wmiObj.ExecQuery("Select * from Win32_LogicalDisk")
for disk in diskinfo:
> ...print disk.N
Sorry, I forgot to make a change. You will need to change "COMPUTER_NAME"
~~~
>>> from win32com.client import GetObject
wmiObj = GetObject("winmgmts:COMPUTER_NAME\\root\\cimv2")
diskinfo = wmiObj.ExecQuery("Select * from Win32_LogicalDisk")
for disk in dis
Here you are:
>>> from win32com.client import GetObject
wmiObj = GetObject("winmgmts:MGW01641\\root\\cimv2")
diskinfo = wmiObj.ExecQuery("Select * from Win32_LogicalDisk")
for disk in diskinfo:
...print disk.Name, disk.FreeSpace
...
A: None
C: 16978259968
D: None
On 28 Feb 2007 12:2
HI,
I am new to Python and wanted to know how to check for the remaining
disk space on my Windows machine using Python? I was thinking of using
the command line "dir" and trying to extract the output from there.
But I'm not sure how to extract command line strings using Python
either.
Anyway help
13 matches
Mail list logo