Re: [Tutor] cgi scripts

2008-11-10 Thread Kent Johnson
On Mon, Nov 10, 2008 at 7:00 AM, Jim Morcombe <[EMAIL PROTECTED]> wrote: > I have been using > import cgitb; cgitb.enable() > > It seems to re-direct some of the errors to the browser, but obviously not > all. Right, if the script fails before that line runs, of course it will have no effect. K

Re: [Tutor] cgi scripts

2008-11-10 Thread Jim Morcombe
Actually, that's good to know. I was thinking it was going to be pretty hard to debug if I couldn't tell the difference between HTML errors and Python errors. I have been using import cgitb; cgitb.enable() It seems to re-direct some of the errors to the browser, but obviously not all. Ji

Re: [Tutor] cgi scripts

2008-11-09 Thread Tim Johnson
On Saturday 08 November 2008, Kent Johnson wrote: > On Sat, Nov 8, 2008 at 3:38 AM, Jim Morcombe <[EMAIL PROTECTED]> wrote: > > I think the problem wasn't in getting the keys and values, but I might > > have been producing illegal HTML code before. > > I think I'd better brush up on my HTML skills

Re: [Tutor] cgi scripts

2008-11-08 Thread Kent Johnson
On Sat, Nov 8, 2008 at 3:38 AM, Jim Morcombe <[EMAIL PROTECTED]> wrote: > I think the problem wasn't in getting the keys and values, but I might have > been producing illegal HTML code before. > I think I'd better brush up on my HTML skills. Poorly formed HTML won't give an internal server error.

Re: [Tutor] cgi scripts

2008-11-08 Thread Don Jennings
(Oops! Forgot to include tutor in recipient.) On 11/8/08, Don Jennings <[EMAIL PROTECTED]> wrote: > Hi, Jim. Actually, improper HTML would cause a problem with the > browser and what it may or may not display. An "Internal Server Error" > does indicate that you had a problem with your code. I sugg

Re: [Tutor] cgi scripts

2008-11-08 Thread Jim Morcombe
Thanks guys, This works :) field_list = '\n' for field in data.keys(): field_list = field_list + '%s : %s\n' % (field, data[field].value) field_list = field_list + '\n' print field_list I think the problem wasn't in getting the keys and values, but I might have been producing illegal HTML

Re: [Tutor] cgi scripts

2008-11-08 Thread Alan Gauld
"Jim Morcombe" <[EMAIL PROTECTED]> wrote The code I sent before had a silly mistake in it. Here is a better example of the things I am trying and failing at. Look at what you are doing in the two examples # This next bit also works and I can see the value of the variable print "JQuiz_q

Re: [Tutor] cgi scripts

2008-11-08 Thread Jim Morcombe
Bt "Crash", I mean the browser displays: Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. The code I sent before had a silly mistake in it. Here is a better example of the things I am trying and failing at. I can

Re: [Tutor] cgi scripts

2008-11-07 Thread Steve Willoughby
Jim Morcombe wrote: I want to print a list of the keys and their values passed to a cgi script by an HTML form. I have tried this, but just seems to crash. When you say "crash", what do you mean, exactly? Any ideas? print "Content-type: text/html\n" print "CGI Form Response\n" print "This