Hi All ,
I'm developing webapplications in classic ASP, currently in VBscript ,
and making extensive use of WSCs to separate code from GUI. Because we
want to transfer over to Python, we are currently trying to implement
parts of our main project into python, to get familiar with the
language. In the future we'd like to use Python for new projects all
together (outside of classic asp). For now we're still stuck with the
classic asp environment.
In a WSC you can implement the usual ASP objects with the statement:
<implements type="ASP" id="ASP"/>
Now, the Python code in my WSC works fine, but as soon as I try to use
an ASP object or object method like, Response .Write() in the WSC , it
fails:
error '80020009'
Exception occurred.
/tools/python.asp, line 9
I have attached a WSC and an ASP page that work, except for the usual
ASP objects, I hope some of you can shed some light on this for me,
information about Python in a WSC from classic AP is pretty scarce on
the Internet. Please note that I added .txt to the usual file extentions
to prevent the files from being blocked. (come to think of it, I don't
even know if attachments work in a post to this mailing list, but I
guess I'll find that out in a minute)
Thanks in advance, and kind regards,
Erik
<?xml version="1.0" encoding="Windows-1252" ?>
<component>
<?component error="true" debug="true"?>
<registration
description="python"
progid="python.WSC"
version="1.00"
classid="{F236F59E-3F6F-44EA-A374-DBFA9F90ECB3}"
>
</registration>
<public>
<method name="open">
</method>
<method name="helloWho">
<PARAMETER name="who"/>
</method>
<method name="helloArray">
<PARAMETER name="who"/>
</method>
<method name="label">
<PARAMETER name="lblName"/>
</method>
</public>
<implements type="ASP" id="ASP"/>
<script language="Python">
<![CDATA[
def open():
Response.Write('output of results converted to a string')
def helloWho(who):
return "Hello "+who+"!"
def helloArray(who):
return "Hello "+who[0]+"!"
def label(lblName):
d = {"server":"mpilgrim"
, "test1":"tesje"
, "test2":"van"
, "test3":"erik"
, "test4":"om"
, "test5":"eend"
, "test6":"te"
, "test7":"kijken"
, "test8":"of"
, "test9":"we"
, "test10":"unnen"
, "test11":"versnellen"}
return d[lblName]
]]>
</script>
</component>
<%@ Language=VBscript %>
<%
set vbwsc =
GetObject("script:"&Server.MapPath("/~components/DAL/python.wsc"))
response.write(vbwsc.helloWho("VBscript world")&"<br>")
vbwsc.open()
%>
_______________________________________________
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32