python cgi newbie question

eif eif at ukonline.co.uk
Mon Sep 3 18:45:41 EDT 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

#!/usr/local/bin/python
import string, cgi, sys
from pprint import pprint

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




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>"





sort1()
output()








More information about the Python-list mailing list