Nick Moszer wrote:
Hello,
I'm occasionally receiving the following error when doing a set of queries:
Traceback (most recent call last):
File psg5220_demo.py, line 236, in find_hdd_drives
partitions = services.query(query)
File ...path..\wmi.py, line 889, in query
return [
To make talking about it easier, I've slightly reworked
your code to make it run completely (ie I've added imports and
the initialisation of the data structures) and
to take advantage of the wmi module's built-in features.
Hopefully it's perfectly clear what's going on; I've just avoided
Hello,
I'm occasionally receiving the following error when doing a set of queries:
Traceback (most recent call last):
File psg5220_demo.py, line 236, in find_hdd_drives
partitions = services.query(query)
File ...path..\wmi.py, line 889, in query
return [ _wmi_object (obj, instance_of,
Hello,
I'm occasionally receiving the following error when doing a set of queries:
Traceback (most recent call last):
File psg5220_demo.py, line 236, in find_hdd_drives
partitions = services.query(query)
File ...path..\wmi.py, line 889, in query
return [ _wmi_object (obj, instance_of,
lovely, thanks again.
On 26/03/2008, Tim Golden [EMAIL PROTECTED] wrote:
mark.a.brand wrote:
what about events,
for example i only want to return error and warning events for the last
4
days from all logs. getting all the events and then filtering them will
be
terrribly slow.
Tim Golden wrote:
[... snip other examples ...]
Even that is a slight optimisation. It usually costs little
to pull back all the fields, so I generally write:
code
import wmi
c = wmi.WMI ()
for service in c.Win32_Service (state=Stopped):
print c.Caption, c.Status
/code
Sorry.
hi:
how do you incorporate a where clause and selected field clause in a wmi
query ?
this gets me caption and state fields for all services
c = wmi.WMI()
for service in c.Win32_Service (['Caption', 'State'])
...
this gets me all fields for stopped services
c = wmi.WMI()
for service in
mark.a.brand wrote:
hi:
how do you incorporate a where clause and selected field clause in a wmi
query ?
this gets me caption and state fields for all services
c = wmi.WMI()
for service in c.Win32_Service (['Caption', 'State'])
...
this gets me all fields for stopped
mark.a.brand wrote:
hi:
how do you incorporate a where clause and selected field clause in a wmi
query ?
this gets me caption and state fields for all services
c = wmi.WMI()
for service in c.Win32_Service (['Caption', 'State'])
...
this gets me all fields for stopped
mark.a.brand wrote:
hi:
how do you incorporate a where clause and selected field clause in a wmi
query ?
this gets me caption and state fields for all services
c = wmi.WMI()
for service in c.Win32_Service (['Caption', 'State'])
...
this gets me all fields for stopped
10 matches
Mail list logo