View Single Post
Old Feb 17th, 2008, 9:11 PM   #18
Swan
Newbie
 
Join Date: Jan 2008
Posts: 27
Rep Power: 0 Swan is on a distinguished road
Re: Running python scripts on localhost

Quote:
Originally Posted by Sane View Post
In CGI-Land, not sending data back to the user is the equivilent of an error. What could appear to be an error is just a lack of you sending the appropriate header information at the top with:

print "Content-type: text/html\r"
print "\r"

Also, look at the "Hello World" script you said you were able to get working. It should have a line at the top that's similar or equal to my first line. Use the hello world's script first line instead of mine, because it knows the correct location of your Python interpreter.
No...! it doesnot work . And the local python interpreter gives no error.


An another working script is :

print "Content-type: text/html\n\n"
print "<html><head><link href=\"../styles.css\" rel=\"stylesheet\" type=\"text/css\"></head><body>"
import os, sys
print "&nbsp;<br><h1>Python %s</h1>" % sys.version
print "</body></html>"

It provides the output :

Python 2.3.3 (#51, Dec 18 2003, 20:22:39) [MSC v.1200 32 bit (Intel)]
Swan is offline   Reply With Quote