python cgi newbie question

eif eif at
Tue Sep 4 00:45:41 CEST 2001

hi again
hopefully for the last time - ive written this cgi program which works fine
within the python environment but when up on a host server only outputs the
html headings and not my actual main program output. Im assuming this is due
to the program not importing the text files properly/at all?
and im wondering if anyone can point me in the right direction. this is the
main program

import string, cgi, sys
from pprint import pprint

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

lecturerlist = [rec.split('|') for rec in open('lecturer.txt').xreadlines()]
examlist = [rec.split('|') for rec in open('exam.txt').xreadlines()]
allocationlist = []

########main program  sort

def output():

 print "<HTML>"
 print "<Body>"

 print "<H5>Allocaction of Exams<H5>"
 print "<BR>"
 print "<H2>Invigilator - Email Address - Subject - Exam length - Exam
Date - Exam Time - Exam Room <H2>"
 print allocationlist
 print "</Body>"
 print "</HTML>"


More information about the Python-list mailing list