...

View Full Version : ASP and Python 2.5



Bartholomew
02-05-2007, 10:13 AM
Hi all

I'd like to use ASP (vbscript) and Python 2.5 in the same .asp-File.

A sample code could be:


<%@LANGUAGE=Python%>
<HTML>
<head></head>
<body>
<h1>Python Test</h1>

<%
#do some python stuff here
print '<p>' #this is a comment
print 'See this is just like most other HTML'
print '<br>'


Response.Write('Python Test<br>')
Response.write('<h3>Smaller heading</hr>')
%>

</body>
</html>

I go now the message that python ist not installed on the IIS. But I have choosen the path of python25 and also the extension (.py).

Could someone help me thanks
Bart

Spudhead
02-05-2007, 05:19 PM
I'm don't have much* experience with Python but I'm pretty sure you can't do this. You'd have to set the .asp file extension to be dealt with by both the ASP and Python script engines, and you can't do that. I think. It'd be like... having Word docs open in Word and in Photoshop, at the same time. Or something.

*any :thumbsup:

Bartholomew
02-06-2007, 01:35 PM
But I thought ASP can deal with several languages like perl, python, vbscript, etc

degsy
02-06-2007, 01:46 PM
I've never used Python with or without ASP but presumably you need to install the scripting engine and then choose the scripting language in IIS.

The pages will still have to be .asp
http://www.4guysfromrolla.com/webtech/082201-1.shtml


You can output VBScript in your pages using <script> tags.
http://aspjavascript.com/lesson04.asp


Also see this for ambiguities
http://blogs.msdn.com/ericlippert/archive/2004/02/19/76438.aspx

Bartholomew
02-12-2007, 11:51 AM
Hi

Thanks a lot for this links. Now it works since I've installed ActiveState Python.

Cheers
Bart



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum