Help with conversion VB script to Python : COM objects



Hi,

I need to re-write a VB script into Python (because I really don't like
VB).

The VB script is used to create a Windows COM object.
(I am more of Unix guy, so COM objects are a little bit alien for me).

At a certain point in the VB script, I have the following line:
objPolTypes = objPmad.Cvar(objPmad.GetPolicyTypeList)

Does anybody what the equivalent in Python would be?
I tried:
objPolTypes = objPmad.Cvar(objPmad.GetPolicyTypeList() )

but then I get the following error:
"
Traceback (most recent call last):
File "C:\Python24\MyProgs\FodFin\test.py", line 11, in ?
objPolTypes = objPmad.cvar(objPmad.GetPolicyTypeList() )
File "<COMObject PMAD.OvPmdPolicyManager>", line 2, in cvar
pywintypes.com_error: (-2147352571, 'Type mismatch.', None, 1)
"

I also tried :
objPolTypes = objPmad.GetPolicyTypeList()

this works but I end of with a list of COM object and have no clue how
to query/use them or what methods are defined for those type of
objects.

Any help really appreciated.

With kind regards,

KRis

.



Relevant Pages

  • Re: newbie question
    ... Python is fun and it's easier to use a real OS to develop the programs, ... Grant it I am a command line junky, ... "The script can be given a executable mode, or permission, using the ... the above seems to me like you are useing windows. ...
    (comp.lang.python)
  • Re: 2.4->2.5 current directory change?
    ... > This appears to be a change in behavior from Python 2.4 to Python 2.5, ... > related to Windows behavior. ... > appears to be the base directory of the running script. ... > modules/etc in your current working directory will not be found. ...
    (comp.lang.python)
  • Re: Help with conversion VB script to Python : COM objects
    ... The VB script is used to create a Windows COM object. ... Does anybody what the equivalent in Python would be? ... objPolTypes = objPmad.Cvar) ...
    (comp.lang.python)
  • stdout and stderr showing output only after script is done
    ... I just installed python 2.4 for windows. ... to install a module that reads off some registry entries. ... and run the python script I wrote. ...
    (comp.lang.python)
  • Re: hide sourcecode
    ... is it possible to protect the python sourcecode? ... >>I have a nice little script and i dont want to show everbody the source. ... >>Im using python on a windows pc. ...
    (comp.lang.python)