WMI - invalid syntax error?

Discussion in 'Python' started by py, Dec 30, 2005.

  1. py

    py Guest

    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???
     
    py, Dec 30, 2005
    #1
    1. Advertising

  2. py

    py Guest

    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
     
    py, Dec 30, 2005
    #2
    1. Advertising

  3. py

    py Guest

    one more note, I am using WMI v0.6 ....however, I also tried it with
    the latest version 1.0 rc2.
     
    py, Dec 30, 2005
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Winterminute
    Replies:
    0
    Views:
    3,144
    Winterminute
    Dec 4, 2003
  2. Patrick.O.Ige
    Replies:
    1
    Views:
    2,021
    Patrick.O.Ige
    Jul 2, 2006
  3. Tim Golden

    RE: WMI - invalid syntax error?

    Tim Golden, Dec 30, 2005, in forum: Python
    Replies:
    1
    Views:
    531
  4. Tim Golden

    RE: WMI - invalid syntax error?

    Tim Golden, Dec 30, 2005, in forum: Python
    Replies:
    2
    Views:
    467
  5. Tim Golden

    RE: WMI - invalid syntax error?

    Tim Golden, Jan 3, 2006, in forum: Python
    Replies:
    2
    Views:
    974
Loading...

Share This Page