F = open() / works in command line but not as CGI script [python]?

Add the following to the beginning of your script:! /usr/bin/env python print 'Content-Type: text/html' print I've always declared the Content-Type in my python cgi scripts, it's polite import cgi import cgitb cgitb.enable() # allows error tracebacks cgitb will show you a nice web based traceback if something went wrong with your script, such as any exceptions thrown.

Add the following to the beginning of your script: #! /usr/bin/env python print 'Content-Type: text/html' print I've always declared the Content-Type in my python cgi scripts, it's polite. Import cgi import cgitb cgitb.enable() # allows error tracebacks cgitb will show you a nice web based traceback if something went wrong with your script, such as any exceptions thrown.

The cgitb helped; I had a relational link error. Strangely, the open() filename is not the same path as the redirect (Location:) filename, which I find strange. I appreciate the help!

– Tom Thorogood Apr 12 at 22:06.

Maybe just a copy/paste-error, but your shebang seems to be indented. Unindent it, and try to start the script via command line on the server, using . /yourscript (not python yourscript, as this is how it probably gets executed by the webserver).

It was just a copy-paste error. But good catch! Thanks.

– Tom Thorogood Apr 12 at 22:06.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions