<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                ### 導航 - [索引](../genindex.xhtml "總目錄") - [模塊](../py-modindex.xhtml "Python 模塊索引") | - [下一頁](wsgiref.xhtml "wsgiref --- WSGI Utilities and Reference Implementation") | - [上一頁](cgi.xhtml "cgi --- Common Gateway Interface support") | - ![](https://box.kancloud.cn/a721fc7ec672275e257bbbfde49a4d4e_16x16.png) - [Python](https://www.python.org/) ? - zh\_CN 3.7.3 [文檔](../index.xhtml) ? - [Python 標準庫](index.xhtml) ? - [互聯網協議和支持](internet.xhtml) ? - $('.inline-search').show(0); | # [`cgitb`](#module-cgitb "cgitb: Configurable traceback handler for CGI scripts.") --- Traceback manager for CGI scripts **Source code:** [Lib/cgitb.py](https://github.com/python/cpython/tree/3.7/Lib/cgitb.py) \[https://github.com/python/cpython/tree/3.7/Lib/cgitb.py\] - - - - - - The [`cgitb`](#module-cgitb "cgitb: Configurable traceback handler for CGI scripts.") module provides a special exception handler for Python scripts. (Its name is a bit misleading. It was originally designed to display extensive traceback information in HTML for CGI scripts. It was later generalized to also display this information in plain text.) After this module is activated, if an uncaught exception occurs, a detailed, formatted report will be displayed. The report includes a traceback showing excerpts of the source code for each level, as well as the values of the arguments and local variables to currently running functions, to help you debug the problem. Optionally, you can save this information to a file instead of sending it to the browser. To enable this feature, simply add this to the top of your CGI script: ``` import cgitb cgitb.enable() ``` The options to the [`enable()`](#cgitb.enable "cgitb.enable") function control whether the report is displayed in the browser and whether the report is logged to a file for later analysis. `cgitb.``enable`(*display=1*, *logdir=None*, *context=5*, *format="html"*)This function causes the [`cgitb`](#module-cgitb "cgitb: Configurable traceback handler for CGI scripts.") module to take over the interpreter's default handling for exceptions by setting the value of [`sys.excepthook`](sys.xhtml#sys.excepthook "sys.excepthook"). The optional argument *display* defaults to `1` and can be set to `0` to suppress sending the traceback to the browser. If the argument *logdir* is present, the traceback reports are written to files. The value of *logdir*should be a directory where these files will be placed. The optional argument *context* is the number of lines of context to display around the current line of source code in the traceback; this defaults to `5`. If the optional argument *format* is `"html"`, the output is formatted as HTML. Any other value forces plain text output. The default value is `"html"`. `cgitb.``text`(*info*, *context=5*)This function handles the exception described by *info* (a 3-tuple containing the result of [`sys.exc_info()`](sys.xhtml#sys.exc_info "sys.exc_info")), formatting its traceback as text and returning the result as a string. The optional argument *context* is the number of lines of context to display around the current line of source code in the traceback; this defaults to `5`. `cgitb.``html`(*info*, *context=5*)This function handles the exception described by *info* (a 3-tuple containing the result of [`sys.exc_info()`](sys.xhtml#sys.exc_info "sys.exc_info")), formatting its traceback as HTML and returning the result as a string. The optional argument *context* is the number of lines of context to display around the current line of source code in the traceback; this defaults to `5`. `cgitb.``handler`(*info=None*)This function handles an exception using the default settings (that is, show a report in the browser, but don't log to a file). This can be used when you've caught an exception and want to report it using [`cgitb`](#module-cgitb "cgitb: Configurable traceback handler for CGI scripts."). The optional *info* argument should be a 3-tuple containing an exception type, exception value, and traceback object, exactly like the tuple returned by [`sys.exc_info()`](sys.xhtml#sys.exc_info "sys.exc_info"). If the *info* argument is not supplied, the current exception is obtained from [`sys.exc_info()`](sys.xhtml#sys.exc_info "sys.exc_info"). ### 導航 - [索引](../genindex.xhtml "總目錄") - [模塊](../py-modindex.xhtml "Python 模塊索引") | - [下一頁](wsgiref.xhtml "wsgiref --- WSGI Utilities and Reference Implementation") | - [上一頁](cgi.xhtml "cgi --- Common Gateway Interface support") | - ![](https://box.kancloud.cn/a721fc7ec672275e257bbbfde49a4d4e_16x16.png) - [Python](https://www.python.org/) ? - zh\_CN 3.7.3 [文檔](../index.xhtml) ? - [Python 標準庫](index.xhtml) ? - [互聯網協議和支持](internet.xhtml) ? - $('.inline-search').show(0); | ? [版權所有](../copyright.xhtml) 2001-2019, Python Software Foundation. Python 軟件基金會是一個非盈利組織。 [請捐助。](https://www.python.org/psf/donations/) 最后更新于 5月 21, 2019. [發現了問題](../bugs.xhtml)? 使用[Sphinx](http://sphinx.pocoo.org/)1.8.4 創建。
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看