What's wrong with my script?

Sheila King sheila at spamcop.net
Fri Sep 14 23:30:37 CEST 2001

On Fri, 14 Sep 2001 23:51:10 +0400 (MSD), Roman Suzi <rnd at onego.ru>
wrote in comp.lang.python in article
<mailman.1000497276.20930.python-list at python.org>:

:May be it is better to put it all into triple-quotes?
:print """Content-type: text/html
:<meta http-equiv="refresh" content="5;URL=http://www.aramedis.de/de/index.htx">
:<body bgcolor=#000000>

Because of the meta-tag contents, you are probably right. The way he had
it before, he was unquoting in the middle of his tag:

print "<meta http-equiv="refresh" content="5;

As others have suggested, looking at the messages in the error log would
also be especially helpful.

Or, try this:

   import cgi
   import sys        # include this
   import traceback  # include this

   sys.stderr = sys.stdout
   print "Content-Type: text/html\n"


     print """

<meta http-equiv="refresh"
<body bgcolor=#000000>

   except:  # trap Python error and display in browser

       print "\n\n<PRE>"
       print "\n</PRE>"

This way, the error messages will display in your browser.

Sheila King

More information about the Python-list mailing list