Python ActiveX Scripting interface

Paul Moore gustav at morpheus.demon.co.uk
Wed Jun 9 22:43:00 CEST 1999


On Wed, 9 Jun 1999 12:07:47 -0400, "Darrell" <news at dorb.com> wrote:

>Check out an earlier thread called "pyscript help" on 6/4/99
>I believe that pyscript.py registers python as a scripting engine.
>I had two problems one was a microsoft dll version problem with comcat.dll
>comcat.dll is used to register com interfaces and I think it gets screwed up
>in SP4.
>The other was a change to the calculator demo.

Hmm, thanks for the pointer. However, I seem to have a matched set of
comcat.dll and ole32.dll (the older versions) so that's not my problem
:-(

For a bit more detail, when I run the following script file (test.ws)
in WSH 2.0 beta, I get the error

D:\winnt\Profiles\Administrator\Desktop\test.ws(0, 1) Windows
Scripting Host: Cannot create script engine : Python

[Script]

<job ID="Test">
<script language="Python">
WScript.Echo("Hello, world!")
</script>
</job>

If I run the supplied "foo2.htm" demo, I just get "Done - errors on
page" displayed, with no indication of *what* error. None of the
python scripted buttons work, but the VBScript one does. The initial
bit of script does execute, though - I can see the results of the
"document.write" calls.

All in all, the whole thing looks very odd...

Actually, I just noticed that the web page directs trace output to the
"win32trace" destination. On starting the client I find that the trace
output says

Collecting Python Trace Output...
 ScriptEngine QI - unknown IID {4954E0D0-FBC7-11D1-8410-006008C3FBFC}
Traceback (innermost last):
  File "E:\Applications\Python\win32com\client\dynamic.py", line 247,
in _make_method_
    fn = self._builtMethods_[name] = tempNameSpace[name]
KeyError: print
Redirecting output to win32trace remote collector
 Hello
Location is
file:///E:/Applications/Python/win32comext/axscript/demos/client/ie/
foo2.htm
Hello from in the form
X is 13
a is Hi there
MyForm is X is 13
a is Hi there
MyForm is

Interesting - the IID it can't find is IActiveScriptProperty. What's
that? It's not mentioned in MSDN (not even the online version on the
MSDN web site, which I assume is fairly up to date...)

Curiouser and curiouser...

Paul.




More information about the Python-list mailing list