Thanks Mark! I've posted your solution over at
microsoft.public.scripting.wsh. It was Steve Fulton over there that
suggested ActiveState. I'm hoping that dong a little Python/WSH posting
over there will peek someone's curiosity about Python!
Don
-----Original Message-----
From: Mark Hammond [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, November 29, 2000 4:32 AM
To: Don Tuttle; Activepython
Subject: RE: ActivePython and WSH.
> After posting this to the Python newsgroup, one response said you
> (ActiveState) may have a global variable in you distribution that
> could make
> this work. Is this true? If so, how does it work and would you point me
> to the docs. If not, is this a feature your could/would add?
I believe I responded to that thread.
Unfortunately, it depends on the ActiveScript host. For example, in IE, you
use the Window object, in WSH, you use the "globals" object.
eg:
globals.MessageBox(strText1 + "\n" + strText2)
It works in VB etc without the "globals." prefix due to a "feature" of
Python namespaces - basically I could not make it work :-(
For ASP, I don't know what the object is - you will need to find that in the
IIS documentation. However, if you dont mind hacking, I have a tip - this
is how I worked out "wsh" uses "global" :-)
If you open win32comext\axscript\client\pyscript.py, search for:
def RegisterNamedItem(self, item):
Add the following 2 lines as the first 2 lines:
import win32traceutil
print "** RegisterNamedItem", item.name
Then, start Pythonwin and select "Trace Collector Debugging Tool". Restart
IIS, and run some Python code. When I did this for WSH, I saw the
following:
** RegisterNamedItem scriptlet
** RegisterNamedItem globals
** RegisterNamedItem WSH
** RegisterNamedItem WScript
And guessed "globals" would be the one. It was :-)
Hope this helps...
Mark.
_______________________________________________
ActivePython mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/activepython