How to open a HTML file when the python cgi program is executing?

Jiri Baum jiri at baum.com.au
Sat Jun 1 23:43:50 EDT 2002


Please attribute stuff when you reply, I don't read everything and almost
missed your question.

>> If you realize this before you've output anything, you can use one of
>> the redirection / refresh headers, such as "Location".

>> print """Content-type: text/html
>> Location: http://replacement-url
>>
>> <p><a href="http://replacement-url">Click here</a></p>

Ken:
> Doesn't seem to work... :(

Does any CGI work for you at all?

If you do just a simple: print "Content-type: text/plain\n\nHello there!\n"
does it show up in the browser?

>> As for frames, there's the main document, which decides which frames get
>> shown; and then the server gets separate requests for each of the
>> frames.  You might want to browse a few pages with telnet to get a feel
>> for how things work.

> Where can I find this document?

Pick a page you like (preferably fairly small).
telnet www.site.com http
GET /rest-of-url.html

Study the output to see how it was done.


Alternatively, get a book on html. Any book on html should do.

Jiri
-- 
Jiri Baum <jiri at baum.com.au>           http://www.csse.monash.edu.au/~jirib
  MAT LinuxPLC project --- http://mat.sf.net --- Machine Automation Tools



More information about the Python-list mailing list