WMI - invalid syntax error?

P

py

Hi,
I am running python 2.4.2 on win xp pro. I have the WMI module from
Tim Golden (http://tgolden.sc.sabren.com/python/wmi.html).

I have some code which does this...

MyScript.py
------------------
import wmi
# the ip of my own local desktop
machine = "1.2.3.4"
try:
w = wmi.WMI(machine) # also tried, wmi.WMI(computer=machine)
except Exception, e:
print "ERROR:", e

c:>python
.....So when I import the script I get the "invalid syntax" error (which
comes from the line, w = wmi.WMI(....))

but in the same window if I just type it in manually I get no error.

Any ideas???
 
P

py

here's the trace...

File "MyScript.py", line 10,
wmiObj = wmi.WMI(machine)
File "wmi.py", line 519, in __init__
handle_com_error (error_info)
File "wmi.py", line 131, in handle_com_error
raise x_wmi, "\n".join (exception_string)
x_wmi: -0x7ffbfe1c - Invalid syntax
 
P

py

one more note, I am using WMI v0.6 ....however, I also tried it with
the latest version 1.0 rc2.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,015
Latest member
AmbrosePal

Latest Threads

Top