I'm just not cut out for web programming, I guess :)

John Salerno johnjsal at NOSPAMgmail.com
Wed May 17 22:51:07 CEST 2006

Ok, I've tinkered with this thing for a while, and I keep fixing little 
problems, but I always get a 500 Internal Server error when I go to this 

I don't necessarily even want help just yet, I'd like to figure it out 
myself, but can someone at least tell me why I'm not getting helpful 
feedback from the cgitb module? Am I using it wrong? The webpage just 
displays the internal server error.


import cryptogen
import cgitb; cgitb.enable()

quote_file = open('quotes.txt')
quote = quote_file.readline().strip()

print '''content-type: text/html

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"

<html lang="en-us">
     <meta http-equiv="content-type" content="text/html; charset=utf-8">

   <body><form action="cryptopage.py">'''

quote = cryptogen.convert_quote(quote)
for word in quote[0].split(' '):
     word_len = len(word)
     print '<input type="text" name="%s" size="%d">' % (word, word_len)

print '<input type="submit" value="Submit"></form></body></html>'

More information about the Python-list mailing list