Active Scripting in Python

J

Jane Austine

I donwloaded win32all for Python 2.3 and installed it.

I manually run pyscript.py and it returned "successfully registered"
message.

For a simple test(on client side), I created the following html:

<script language=Python>
alert("hello world")
</script>

And opened it in IE6.0 on WinXP. Unfortunately, it doesn't show
anything.

After googling, I tried "pyscript.py --debug" and the trace collector
shows:

Object with win32trace dispatcher created (object=None)
in _InvokeEx_ with GetInterfaceSafetyOptions 0 1
(IID('{BB1A2AE2-A4F9-11CF-8F20-00805F2CD064}'),) None None
in _InvokeEx_ with GetInterfaceSafetyOptions 0 1
(IID('{BB1A2AE1-A4F9-11CF-8F20-00805F2CD064}'),) None None

Am I doing something stupid?

Jane
 
S

Syver Enstad

I donwloaded win32all for Python 2.3 and installed it.

I manually run pyscript.py and it returned "successfully registered"
message.

For a simple test(on client side), I created the following html:

<script language=Python>
alert("hello world")
</script>

And opened it in IE6.0 on WinXP. Unfortunately, it doesn't show
anything.

After googling, I tried "pyscript.py --debug" and the trace collector
shows:

Object with win32trace dispatcher created (object=None)
in _InvokeEx_ with GetInterfaceSafetyOptions 0 1
(IID('{BB1A2AE2-A4F9-11CF-8F20-00805F2CD064}'),) None None
in _InvokeEx_ with GetInterfaceSafetyOptions 0 1
(IID('{BB1A2AE1-A4F9-11CF-8F20-00805F2CD064}'),) None None

Am I doing something stupid?

I think Mark Hammond has disabled the scripting extensions by default,
go to Mark Hammonds site, there should be an explanation on how to
enable it there...
 
M

Mark McEahern

I donwloaded win32all for Python 2.3 and installed it.

I manually run pyscript.py and it returned "successfully registered"
message.

For a simple test(on client side), I created the following html:

<script language=Python>
alert("hello world")
</script>

And opened it in IE6.0 on WinXP. Unfortunately, it doesn't show
anything.

I can't test this right now because my Windows machine at home is dead
(long story), but have you tried using:

print "hello world"

OR

document.write("hello world")

I guess my question is whether "alert" is available when you're using
language="Python".

// m
 
C

Changjune Kim

Jane Austine said:
I donwloaded win32all for Python 2.3 and installed it.

I manually run pyscript.py and it returned "successfully registered"
message.

For a simple test(on client side), I created the following html:

<script language=Python>
alert("hello world")
</script>

And opened it in IE6.0 on WinXP. Unfortunately, it doesn't show
anything.

After googling, I tried "pyscript.py --debug" and the trace collector
shows:

Object with win32trace dispatcher created (object=None)
in _InvokeEx_ with GetInterfaceSafetyOptions 0 1
(IID('{BB1A2AE2-A4F9-11CF-8F20-00805F2CD064}'),) None None
in _InvokeEx_ with GetInterfaceSafetyOptions 0 1
(IID('{BB1A2AE1-A4F9-11CF-8F20-00805F2CD064}'),) None None

Am I doing something stupid?

Jane

Try pyscript_rexec.py instead, with the line 184(raise) of rexec.py
commented out.
 
C

Cousin Stanley

Kim ...

Thanks for the information ...

Disabling the raise statement in pyscript.py
and then running pyscript_rexec.py worked OK ...

/Python/Lib/site-packages/win32comext/axscript/client

pyscript.py

def __setattr__(self, attr, value) :
...
# raise AttributeError, attr # line disabled
...

python pyscript_rexec.py # Python Script Registration

Example ...

http://fastq.com/~sckitching/Python/win32_activeX_pyscript.htm

Only tested with .... < win98_SE | IE6 | Python 2.2.1 >
 

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,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top