search.html 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8" />
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  6. <title>Search &#8212; Python 3.12.0 documentation</title><meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <link rel="stylesheet" type="text/css" href="_static/pygments.css" />
  8. <link rel="stylesheet" type="text/css" href="_static/pydoctheme.css?digest=b37c26da2f7529d09fe70b41c4b2133fe4931a90" />
  9. <link id="pygments_dark_css" media="(prefers-color-scheme: dark)" rel="stylesheet" type="text/css" href="_static/pygments_dark.css" />
  10. <script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
  11. <script src="_static/jquery.js"></script>
  12. <script src="_static/underscore.js"></script>
  13. <script src="_static/doctools.js"></script>
  14. <script src="_static/sidebar.js"></script>
  15. <script src="_static/searchtools.js"></script>
  16. <script src="_static/language_data.js"></script>
  17. <link rel="search" type="application/opensearchdescription+xml"
  18. title="Search within Python 3.12.0 documentation"
  19. href="_static/opensearch.xml"/>
  20. <link rel="author" title="About these documents" href="about.html" />
  21. <link rel="index" title="Index" href="genindex.html" />
  22. <link rel="search" title="Search" href="#" />
  23. <link rel="copyright" title="Copyright" href="copyright.html" />
  24. <script src="searchindex.js" defer></script>
  25. <link rel="canonical" href="https://docs.python.org/3/search.html" />
  26. <style>
  27. @media only screen {
  28. table.full-width-table {
  29. width: 100%;
  30. }
  31. }
  32. </style>
  33. <link rel="stylesheet" href="_static/pydoctheme_dark.css" media="(prefers-color-scheme: dark)" id="pydoctheme_dark_css">
  34. <link rel="shortcut icon" type="image/png" href="_static/py.svg" />
  35. <script type="text/javascript" src="_static/copybutton.js"></script>
  36. <script type="text/javascript" src="_static/menu.js"></script>
  37. <script type="text/javascript" src="_static/themetoggle.js"></script>
  38. <meta name="robots" content="noindex">
  39. <script type="text/javascript">
  40. const GLOSSARY_PAGE = 'glossary.html';
  41. document.addEventListener('DOMContentLoaded', function() {
  42. fetch('_static/glossary.json')
  43. .then(function(response) {
  44. if (response.ok) {
  45. return response.json();
  46. } else {
  47. throw new Error('Failed to fetch glossary.json');
  48. }
  49. })
  50. .then(function(glossary) {
  51. const RESULT_TEMPLATE = '<div style="display: none" class="admonition seealso" id="glossary-result">' +
  52. ' <p class="topic-title">' +
  53. ' <a class="glossary-title" href="#"></a>' +
  54. ' </p>' +
  55. ' <div class="glossary-body"></div>' +
  56. '</div>';
  57. let searchResults = document.getElementById('search-results');
  58. searchResults.insertAdjacentHTML('afterbegin', RESULT_TEMPLATE);
  59. const params = new URLSearchParams(document.location.search).get("q");
  60. if (params) {
  61. const searchParam = params.toLowerCase();
  62. const glossaryItem = glossary[searchParam];
  63. if (glossaryItem) {
  64. let resultDiv = document.getElementById('glossary-result');
  65. // set up the title text with a link to the glossary page
  66. let glossaryTitle = resultDiv.querySelector('.glossary-title');
  67. glossaryTitle.textContent = 'Glossary: ' + glossaryItem.title;
  68. const linkTarget = searchParam.replace(/ /g, '-');
  69. glossaryTitle.href = GLOSSARY_PAGE + '#term-' + linkTarget;
  70. // rewrite any anchor links (to other glossary terms)
  71. // to have a full reference to the glossary page
  72. let body = document.createElement('div');
  73. body.innerHTML = glossaryItem.body;
  74. const anchorLinks = body.querySelectorAll('a[href^="#"]');
  75. anchorLinks.forEach(function(link) {
  76. const currentUrl = link.getAttribute('href');
  77. link.href = GLOSSARY_PAGE + currentUrl;
  78. });
  79. resultDiv.querySelector('.glossary-body').appendChild(body);
  80. resultDiv.style.display = '';
  81. } else {
  82. document.getElementById('glossary-result').style.display = 'none';
  83. }
  84. }
  85. })
  86. .catch(function(error) {
  87. console.error(error);
  88. });
  89. });
  90. </script>
  91. </head>
  92. <body>
  93. <div class="mobile-nav">
  94. <input type="checkbox" id="menuToggler" class="toggler__input" aria-controls="navigation"
  95. aria-pressed="false" aria-expanded="false" role="button" aria-label="Menu" />
  96. <nav class="nav-content" role="navigation">
  97. <label for="menuToggler" class="toggler__label">
  98. <span></span>
  99. </label>
  100. <span class="nav-items-wrapper">
  101. <a href="https://www.python.org/" class="nav-logo">
  102. <img src="_static/py.svg" alt="Logo"/>
  103. </a>
  104. <span class="version_switcher_placeholder"></span>
  105. </span>
  106. </nav>
  107. <div class="menu-wrapper">
  108. <nav class="menu" role="navigation" aria-label="main navigation">
  109. <div class="language_switcher_placeholder"></div>
  110. <label class="theme-selector-label">
  111. Theme
  112. <select class="theme-selector" oninput="activateTheme(this.value)">
  113. <option value="auto" selected>Auto</option>
  114. <option value="light">Light</option>
  115. <option value="dark">Dark</option>
  116. </select>
  117. </label>
  118. </nav>
  119. </div>
  120. </div>
  121. <div class="related" role="navigation" aria-label="related navigation">
  122. <h3>Navigation</h3>
  123. <ul>
  124. <li class="right" style="margin-right: 10px">
  125. <a href="genindex.html" title="General Index"
  126. accesskey="I">index</a></li>
  127. <li class="right" >
  128. <a href="py-modindex.html" title="Python Module Index"
  129. >modules</a> |</li>
  130. <li><img src="_static/py.svg" alt="python logo" style="vertical-align: middle; margin-top: -1px"/></li>
  131. <li><a href="https://www.python.org/">Python</a> &#187;</li>
  132. <li class="switchers">
  133. <div class="language_switcher_placeholder"></div>
  134. <div class="version_switcher_placeholder"></div>
  135. </li>
  136. <li>
  137. </li>
  138. <li id="cpython-language-and-version">
  139. <a href="index.html">3.12.0 Documentation</a> &#187;
  140. </li>
  141. <li class="nav-item nav-item-this"><a href="">Search</a></li>
  142. <li class="right">
  143. <label class="theme-selector-label">
  144. Theme
  145. <select class="theme-selector" oninput="activateTheme(this.value)">
  146. <option value="auto" selected>Auto</option>
  147. <option value="light">Light</option>
  148. <option value="dark">Dark</option>
  149. </select>
  150. </label> |</li>
  151. </ul>
  152. </div>
  153. <div class="document">
  154. <div class="documentwrapper">
  155. <div class="bodywrapper">
  156. <div class="body" role="main">
  157. <h1 id="search-documentation">Search</h1>
  158. <noscript>
  159. <div class="admonition warning">
  160. <p>
  161. Please activate JavaScript to enable the search
  162. functionality.
  163. </p>
  164. </div>
  165. </noscript>
  166. <p>
  167. Searching for multiple words only shows matches that contain
  168. all words.
  169. </p>
  170. <form action="" method="get">
  171. <input type="text" name="q" aria-labelledby="search-documentation" value="" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
  172. <input type="submit" value="search" />
  173. <span id="search-progress" style="padding-left: 10px"></span>
  174. </form>
  175. <div id="search-results">
  176. </div>
  177. <div class="clearer"></div>
  178. </div>
  179. </div>
  180. </div>
  181. <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
  182. <div class="sphinxsidebarwrapper">
  183. </div>
  184. </div>
  185. <div class="clearer"></div>
  186. </div>
  187. <div class="related" role="navigation" aria-label="related navigation">
  188. <h3>Navigation</h3>
  189. <ul>
  190. <li class="right" style="margin-right: 10px">
  191. <a href="genindex.html" title="General Index"
  192. >index</a></li>
  193. <li class="right" >
  194. <a href="py-modindex.html" title="Python Module Index"
  195. >modules</a> |</li>
  196. <li><img src="_static/py.svg" alt="python logo" style="vertical-align: middle; margin-top: -1px"/></li>
  197. <li><a href="https://www.python.org/">Python</a> &#187;</li>
  198. <li class="switchers">
  199. <div class="language_switcher_placeholder"></div>
  200. <div class="version_switcher_placeholder"></div>
  201. </li>
  202. <li>
  203. </li>
  204. <li id="cpython-language-and-version">
  205. <a href="index.html">3.12.0 Documentation</a> &#187;
  206. </li>
  207. <li class="nav-item nav-item-this"><a href="">Search</a></li>
  208. <li class="right">
  209. <label class="theme-selector-label">
  210. Theme
  211. <select class="theme-selector" oninput="activateTheme(this.value)">
  212. <option value="auto" selected>Auto</option>
  213. <option value="light">Light</option>
  214. <option value="dark">Dark</option>
  215. </select>
  216. </label> |</li>
  217. </ul>
  218. </div>
  219. <div class="footer">
  220. &copy; <a href="copyright.html">Copyright</a> 2001-2023, Python Software Foundation.
  221. <br />
  222. This page is licensed under the Python Software Foundation License Version 2.
  223. <br />
  224. Examples, recipes, and other code in the documentation are additionally licensed under the Zero Clause BSD License.
  225. <br />
  226. See <a href="/license.html">History and License</a> for more information.<br />
  227. <br />
  228. The Python Software Foundation is a non-profit corporation.
  229. <a href="https://www.python.org/psf/donations/">Please donate.</a>
  230. <br />
  231. <br />
  232. Last updated on Oct 02, 2023.
  233. <a href="/bugs.html">Found a bug</a>?
  234. <br />
  235. Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.5.0.
  236. </div>
  237. </body>
  238. </html>