WMI - invalid syntax error?

py codecraig at gmail.com
Fri Dec 30 09:26:08 EST 2005


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
>> from MyScript import *
>>> ERROR: -0x7ffbfe1c - Invalid syntax

>> import wmi
>> w = wmi.WMI("1.2.3.4")
>>

....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???




More information about the Python-list mailing list