summaryrefslogtreecommitdiffstats
path: root/Doc/library/cgi.rst
diff options
context:
space:
mode:
Diffstat (limited to 'Doc/library/cgi.rst')
-rw-r--r--Doc/library/cgi.rst15
1 files changed, 9 insertions, 6 deletions
diff --git a/Doc/library/cgi.rst b/Doc/library/cgi.rst
index c8d9903..e9b2c77 100644
--- a/Doc/library/cgi.rst
+++ b/Doc/library/cgi.rst
@@ -65,16 +65,18 @@ Using the cgi module
Begin by writing ``import cgi``.
-When you write a new script, consider adding the line::
+When you write a new script, consider adding these lines::
- import cgitb; cgitb.enable()
+ import cgitb
+ cgitb.enable()
This activates a special exception handler that will display detailed reports in
the Web browser if any errors occur. If you'd rather not show the guts of your
program to users of your script, you can have the reports saved to files
-instead, with a line like this::
+instead, with code like this::
- import cgitb; cgitb.enable(display=0, logdir="/tmp")
+ import cgitb
+ cgitb.enable(display=0, logdir="/tmp")
It's very helpful to use this feature during script development. The reports
produced by :mod:`cgitb` provide information that can save you a lot of time in
@@ -445,9 +447,10 @@ discarded altogether.
Fortunately, once you have managed to get your script to execute *some* code,
you can easily send tracebacks to the Web browser using the :mod:`cgitb` module.
-If you haven't done so already, just add the line::
+If you haven't done so already, just add the lines::
- import cgitb; cgitb.enable()
+ import cgitb
+ cgitb.enable()
to the top of your script. Then try running it again; when a problem occurs,
you should see a detailed report that will likely make apparent the cause of the