473,569 Members | 2,870 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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="Pytho n">
document.write( "Python's throwing a party on the client-side!")
</script>
<br />

<script language="Pytho n" 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 1436

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*******@gmai l.com> wrote in message news:11******** *************@g 44g2000cwa.goog legroups.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="Pytho n">
document.write( "Python's throwing a party on the client-side!")
</script>
<br />

<script language="Pytho n" 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*******@gmai l.com> wrote in message news:11******** **************@ f14g2000cwb.goo glegroups.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*******@gmai l.com> wrote in message news:11******** *************@f 14g2000cwb.goog legroups.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
7703
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7618
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7926
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8138
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
6287
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5514
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3657
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1228
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
946
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.