Sucking in a text file
Chris Gonnerman
chris.gonnerman at usa.net
Sat Mar 10 10:53:26 EST 2001
More information about the Python-list mailing list
Sat Mar 10 10:53:26 EST 2001
- Previous message (by thread): Sucking in a text file
- Next message (by thread): Private class and instance methods?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
----- 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() hdrf.close() sys.stdout.write(header) Hope this helps.
- Previous message (by thread): Sucking in a text file
- Next message (by thread): Private class and instance methods?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list