[Tutor] Re: Translating to Python [perl --> python]

Lloyd Kvam pythontutor@venix.com
Tue, 02 Jul 2002 09:06:06 -0400


(I presume Danny is asleep by this time.)
Simply delete the two lines that contain cgitb references, or make
them comments:
#import cgitb
#cgitb.enable()

cgitb ONLY comes into play if your script fails and raises an exception.
You can omit cgitb without affecting your normal processing.

Kyle Babich wrote:

> I would like to do the entire thing without cgitb because I don't have
> the module and I don't want to try to convincing my host to install it.
>  Is it possible to do it without cgitb?
> 
> On Tue, 2 Jul 2002 01:16:11 -0700 (PDT), "Danny Yoo"
> <dyoo@hkn.eecs.berkeley.edu> said:
> 
>>
>>On Mon, 1 Jul 2002, Kyle Babich wrote:
>>
>>
>>>How could I do this without cgitb?
>>>
>>Hi Kyle,
>>
>>Which part, exactly, would you like to do without the 'cgitb' traceback
>>module?  cgitb modifies the programming environment slightly so that
>>raised exceptions give nicely formatted error messages back to the web
>>browser.
>>
>>
>>Try commenting the cgitb lines first, and deliberately introduce a
>>syntax
>>error in the script --- you'll notice that the web server doesn't
>>output
>>too much useful information back to the user (although it will be in
>>the
>>error log).  On Apache, a bug in a CGI script brings up the
>>infuriatingly
>>uninformative "Internal Server Error" page.
>>
>>
>>Afterwards, uncomment the cgitb-related lines and try again, and you'll
>>see a difference.  It's not mandatory, but it is pretty useful.  I
>>usually
>>keep 'cgitb' on because it's such a nice debugging tool, and looks
>>nicer
>>than having to do a:
>>
>>    tail -f /var/log/apache/error.log
>>
>>which would be an alternative way of watching script problems.
>>
>>
>>If you have more questions, please feel free to ask!  By the way, it
>>sounds like you're coming from a Perl background.  How much Perl do you
>>know already?  We can tailor our answers to take advantage of your
>>experiences in other languages, if that would be helpful for you.
>>
>>
>>Good luck!
>>
>>
>>
>>
>>
> 
> 
> _______________________________________________
> Tutor maillist  -  Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor
> 
> 


-- 
Lloyd Kvam
Venix Corp.
1 Court Street, Suite 378
Lebanon, NH 03766-1358

voice: 
603-443-6155
fax: 
801-459-9582