Sucking in a text file
chris.gonnerman at usa.net
Sat Mar 10 16:53:26 CET 2001
----- Original Message -----
From: "Simon Faulkner" <News at Titanic.co.uk>
Subject: Sucking in a text file
> I have a .py cgi script that writes a page to the web and it works!
> To allow the users to customise the out put I would like the script to
> suck in the first part of the page from a text file and then to spit
> this out to the web server.
> Is this easy or do I need to open the file and read each byte in turn?
hdrf = open("my_header.html", "r") # the "r" is not required actually
header = hdrf.read()
Hope this helps.
More information about the Python-list