调试CGI python [英] Debugging CGI python

查看:61
本文介绍了调试CGI python的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

除了每次浏览器生成错误时查看日志文件之外,还有没有其他简便的方法可以调试cgi python程序?

Is there any easy way to debug cgi python programs apart from looking at the log file each time the browser generates an error?

推荐答案

您可以使用 cgitb 模块。就像

You can use the cgitb module. It's as simple as

import cgitb
cgitb.enable()

它并不总是有效的(例如,对于权限错误或某些其他类型的错误不会帮助您),但是在这样做的时候有帮助!

It doesn't always work (e.g. it won't help you for permission errors, or certain other kinds of errors), but when it does it's quite helpful!

这篇关于调试CGI python的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆