Sunday, April 3, 2022

[SOLVED] Debugging CGI python

Issue

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


Solution

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!



Answered By - Ismail Badawi
Answer Checked By - Senaida (WPSolving Volunteer)