473,320 Members | 1,838 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Python and ASP

I recently uploaded a sample ASP-Python page to my web server and it
didn't show up correctly. Before I explain what it did, I should
mention that I got the same result when I tried to view the page from
my desktop (winxp user). So when I tried to view the sample ASP with
Python page from my desktop and web server, all that showed up was the
source code. I'm not sure exactly what this means since I know that
python 2.4 is installed on my computer and the ASP page still didn't
show up correctly. Here's the sample ASP-Python code, courtesy of
http://www.4guysfromrolla.com/webtech/082201-1.shtml :
<html>
<head>
<title>ASP-Python Test Page</title>
</head>
<body>
<%@ Language=Python %>
<%
Response.Write("Python lives in the ASP delimeters!")
%>
<br />

<script language="Python">
document.write("Python's throwing a party on the client-side!")
</script>
<br />

<script language="Python" runat="server">
Response.Write("Python gets ready to rumble inside a server-side
scripting block!")
</script>
</body>
</html>


Any ideas about what I am doing wrong? Thanks.

Feb 14 '06 #1
7 1430

Did you save it with ".asp" extension?
Is the directory enabled to run scripts?
Can you run any other server-side script snippet (say VBscript)?

Feb 14 '06 #2
It looks like you have a space before the first Response.Write.
This works fine for me if that line is left-justified.

hth
Roger
"Tempo" <br*******@gmail.com> wrote in message news:11*********************@g44g2000cwa.googlegro ups.com...
I recently uploaded a sample ASP-Python page to my web server and it
didn't show up correctly. Before I explain what it did, I should
mention that I got the same result when I tried to view the page from
my desktop (winxp user). So when I tried to view the sample ASP with
Python page from my desktop and web server, all that showed up was the
source code. I'm not sure exactly what this means since I know that
python 2.4 is installed on my computer and the ASP page still didn't
show up correctly. Here's the sample ASP-Python code, courtesy of
http://www.4guysfromrolla.com/webtech/082201-1.shtml :
<html>
<head>
<title>ASP-Python Test Page</title>
</head>
<body>
<%@ Language=Python %>
<%
Response.Write("Python lives in the ASP delimeters!")
%>
<br />

<script language="Python">
document.write("Python's throwing a party on the client-side!")
</script>
<br />

<script language="Python" runat="server">
Response.Write("Python gets ready to rumble inside a server-side
scripting block!")
</script>
</body>
</html>


Any ideas about what I am doing wrong? Thanks.



----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= East/West-Coast Server Farms - Total Privacy via Encryption =---
Feb 15 '06 #3
It still doesn't work. I fixed that one error that you pointed out
Roger Upole, but it still isn't working. All I did was copy and past
the code above, plus Roger's fix, into Notepad2 and saved it as a
'.asp'. When I opened it in Firefox, all that showed up was the source
code of the file. It seems like it is reading the '.asp' file as a text
file in the web browser. Any further ideas? Thanks.

Feb 15 '06 #4
ASP files have to be served up by a web server.

Roger

"Tempo" <br*******@gmail.com> wrote in message news:11**********************@f14g2000cwb.googlegr oups.com...
It still doesn't work. I fixed that one error that you pointed out
Roger Upole, but it still isn't working. All I did was copy and past
the code above, plus Roger's fix, into Notepad2 and saved it as a
'.asp'. When I opened it in Firefox, all that showed up was the source
code of the file. It seems like it is reading the '.asp' file as a text
file in the web browser. Any further ideas? Thanks.



----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= East/West-Coast Server Farms - Total Privacy via Encryption =---
Feb 15 '06 #5
What do you mean? I can't just upload the file to the server that is
going to host my site?

Feb 15 '06 #6
No, what I mean is that until you upload the file to the web server and
request it back thru the server, it's just a text source file. However,
let me make sure I understood your previous post. I had thought
you meant you were opening the ASP file directly, as in locally and
not from a web service.
Did I read that right ?

Roger

"Tempo" <br*******@gmail.com> wrote in message news:11*********************@f14g2000cwb.googlegro ups.com...
What do you mean? I can't just upload the file to the server that is
going to host my site?



----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= East/West-Coast Server Farms - Total Privacy via Encryption =---
Feb 15 '06 #7
Tempo wrote:
What do you mean? I can't just upload the file to the server that is
going to host my site?

Note that the language identifier directive

<%@ Language=Python %>

should come right at the top of the file to do any good.

Is this an ISP-managed web server? If so it's possible that they haven't
(and may not want to) installed the Active Scripting features of Python
that come with the win32all extensions.

I can't remember offhand whether a separate step is necessary after
installing win32all, but without those extensions IIS just won't
recognize Python as an Active Scripting language.

regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC www.holdenweb.com
PyCon TX 2006 www.python.org/pycon/

Feb 15 '06 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.