gooderp18绿色标准版
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

436 lines
26KB

  1. <!DOCTYPE html>
  2. <html lang="en" data-content_root="../">
  3. <head>
  4. <meta charset="utf-8" />
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />
  6. <meta property="og:title" content="modulefinder — Find modules used by a script" />
  7. <meta property="og:type" content="website" />
  8. <meta property="og:url" content="https://docs.python.org/3/library/modulefinder.html" />
  9. <meta property="og:site_name" content="Python documentation" />
  10. <meta property="og:description" content="Source code: Lib/modulefinder.py This module provides a ModuleFinder class that can be used to determine the set of modules imported by a script. modulefinder.py can also be run as a script, giving..." />
  11. <meta property="og:image" content="https://docs.python.org/3/_static/og-image.png" />
  12. <meta property="og:image:alt" content="Python documentation" />
  13. <meta name="description" content="Source code: Lib/modulefinder.py This module provides a ModuleFinder class that can be used to determine the set of modules imported by a script. modulefinder.py can also be run as a script, giving..." />
  14. <meta property="og:image:width" content="200" />
  15. <meta property="og:image:height" content="200" />
  16. <meta name="theme-color" content="#3776ab" />
  17. <title>modulefinder — Find modules used by a script &#8212; Python 3.12.3 documentation</title><meta name="viewport" content="width=device-width, initial-scale=1.0">
  18. <link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=80d5e7a1" />
  19. <link rel="stylesheet" type="text/css" href="../_static/pydoctheme.css?v=bb723527" />
  20. <link id="pygments_dark_css" media="(prefers-color-scheme: dark)" rel="stylesheet" type="text/css" href="../_static/pygments_dark.css?v=b20cc3f5" />
  21. <script src="../_static/documentation_options.js?v=2c828074"></script>
  22. <script src="../_static/doctools.js?v=888ff710"></script>
  23. <script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
  24. <script src="../_static/sidebar.js"></script>
  25. <link rel="search" type="application/opensearchdescription+xml"
  26. title="Search within Python 3.12.3 documentation"
  27. href="../_static/opensearch.xml"/>
  28. <link rel="author" title="About these documents" href="../about.html" />
  29. <link rel="index" title="Index" href="../genindex.html" />
  30. <link rel="search" title="Search" href="../search.html" />
  31. <link rel="copyright" title="Copyright" href="../copyright.html" />
  32. <link rel="next" title="runpy — Locating and executing Python modules" href="runpy.html" />
  33. <link rel="prev" title="pkgutil — Package extension utility" href="pkgutil.html" />
  34. <link rel="canonical" href="https://docs.python.org/3/library/modulefinder.html" />
  35. <style>
  36. @media only screen {
  37. table.full-width-table {
  38. width: 100%;
  39. }
  40. }
  41. </style>
  42. <link rel="stylesheet" href="../_static/pydoctheme_dark.css" media="(prefers-color-scheme: dark)" id="pydoctheme_dark_css">
  43. <link rel="shortcut icon" type="image/png" href="../_static/py.svg" />
  44. <script type="text/javascript" src="../_static/copybutton.js"></script>
  45. <script type="text/javascript" src="../_static/menu.js"></script>
  46. <script type="text/javascript" src="../_static/search-focus.js"></script>
  47. <script type="text/javascript" src="../_static/themetoggle.js"></script>
  48. </head>
  49. <body>
  50. <div class="mobile-nav">
  51. <input type="checkbox" id="menuToggler" class="toggler__input" aria-controls="navigation"
  52. aria-pressed="false" aria-expanded="false" role="button" aria-label="Menu" />
  53. <nav class="nav-content" role="navigation">
  54. <label for="menuToggler" class="toggler__label">
  55. <span></span>
  56. </label>
  57. <span class="nav-items-wrapper">
  58. <a href="https://www.python.org/" class="nav-logo">
  59. <img src="../_static/py.svg" alt="Python logo"/>
  60. </a>
  61. <span class="version_switcher_placeholder"></span>
  62. <form role="search" class="search" action="../search.html" method="get">
  63. <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" class="search-icon">
  64. <path fill-rule="nonzero" fill="currentColor" d="M15.5 14h-.79l-.28-.27a6.5 6.5 0 001.48-5.34c-.47-2.78-2.79-5-5.59-5.34a6.505 6.505 0 00-7.27 7.27c.34 2.8 2.56 5.12 5.34 5.59a6.5 6.5 0 005.34-1.48l.27.28v.79l4.25 4.25c.41.41 1.08.41 1.49 0 .41-.41.41-1.08 0-1.49L15.5 14zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"></path>
  65. </svg>
  66. <input placeholder="Quick search" aria-label="Quick search" type="search" name="q" />
  67. <input type="submit" value="Go"/>
  68. </form>
  69. </span>
  70. </nav>
  71. <div class="menu-wrapper">
  72. <nav class="menu" role="navigation" aria-label="main navigation">
  73. <div class="language_switcher_placeholder"></div>
  74. <label class="theme-selector-label">
  75. Theme
  76. <select class="theme-selector" oninput="activateTheme(this.value)">
  77. <option value="auto" selected>Auto</option>
  78. <option value="light">Light</option>
  79. <option value="dark">Dark</option>
  80. </select>
  81. </label>
  82. <div>
  83. <h3><a href="../contents.html">Table of Contents</a></h3>
  84. <ul>
  85. <li><a class="reference internal" href="#"><code class="xref py py-mod docutils literal notranslate"><span class="pre">modulefinder</span></code> — Find modules used by a script</a><ul>
  86. <li><a class="reference internal" href="#example-usage-of-modulefinder">Example usage of <code class="xref py py-class docutils literal notranslate"><span class="pre">ModuleFinder</span></code></a></li>
  87. </ul>
  88. </li>
  89. </ul>
  90. </div>
  91. <div>
  92. <h4>Previous topic</h4>
  93. <p class="topless"><a href="pkgutil.html"
  94. title="previous chapter"><code class="xref py py-mod docutils literal notranslate"><span class="pre">pkgutil</span></code> — Package extension utility</a></p>
  95. </div>
  96. <div>
  97. <h4>Next topic</h4>
  98. <p class="topless"><a href="runpy.html"
  99. title="next chapter"><code class="xref py py-mod docutils literal notranslate"><span class="pre">runpy</span></code> — Locating and executing Python modules</a></p>
  100. </div>
  101. <div role="note" aria-label="source link">
  102. <h3>This Page</h3>
  103. <ul class="this-page-menu">
  104. <li><a href="../bugs.html">Report a Bug</a></li>
  105. <li>
  106. <a href="https://github.com/python/cpython/blob/main/Doc/library/modulefinder.rst"
  107. rel="nofollow">Show Source
  108. </a>
  109. </li>
  110. </ul>
  111. </div>
  112. </nav>
  113. </div>
  114. </div>
  115. <div class="related" role="navigation" aria-label="related navigation">
  116. <h3>Navigation</h3>
  117. <ul>
  118. <li class="right" style="margin-right: 10px">
  119. <a href="../genindex.html" title="General Index"
  120. accesskey="I">index</a></li>
  121. <li class="right" >
  122. <a href="../py-modindex.html" title="Python Module Index"
  123. >modules</a> |</li>
  124. <li class="right" >
  125. <a href="runpy.html" title="runpy — Locating and executing Python modules"
  126. accesskey="N">next</a> |</li>
  127. <li class="right" >
  128. <a href="pkgutil.html" title="pkgutil — Package extension utility"
  129. accesskey="P">previous</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.3 Documentation</a> &#187;
  140. </li>
  141. <li class="nav-item nav-item-1"><a href="index.html" >The Python Standard Library</a> &#187;</li>
  142. <li class="nav-item nav-item-2"><a href="modules.html" accesskey="U">Importing Modules</a> &#187;</li>
  143. <li class="nav-item nav-item-this"><a href=""><code class="xref py py-mod docutils literal notranslate"><span class="pre">modulefinder</span></code> — Find modules used by a script</a></li>
  144. <li class="right">
  145. <div class="inline-search" role="search">
  146. <form class="inline-search" action="../search.html" method="get">
  147. <input placeholder="Quick search" aria-label="Quick search" type="search" name="q" id="search-box" />
  148. <input type="submit" value="Go" />
  149. </form>
  150. </div>
  151. |
  152. </li>
  153. <li class="right">
  154. <label class="theme-selector-label">
  155. Theme
  156. <select class="theme-selector" oninput="activateTheme(this.value)">
  157. <option value="auto" selected>Auto</option>
  158. <option value="light">Light</option>
  159. <option value="dark">Dark</option>
  160. </select>
  161. </label> |</li>
  162. </ul>
  163. </div>
  164. <div class="document">
  165. <div class="documentwrapper">
  166. <div class="bodywrapper">
  167. <div class="body" role="main">
  168. <section id="module-modulefinder">
  169. <span id="modulefinder-find-modules-used-by-a-script"></span><h1><a class="reference internal" href="#module-modulefinder" title="modulefinder: Find modules used by a script."><code class="xref py py-mod docutils literal notranslate"><span class="pre">modulefinder</span></code></a> — Find modules used by a script<a class="headerlink" href="#module-modulefinder" title="Link to this heading">¶</a></h1>
  170. <p><strong>Source code:</strong> <a class="reference external" href="https://github.com/python/cpython/tree/3.12/Lib/modulefinder.py">Lib/modulefinder.py</a></p>
  171. <hr class="docutils" />
  172. <p>This module provides a <a class="reference internal" href="#modulefinder.ModuleFinder" title="modulefinder.ModuleFinder"><code class="xref py py-class docutils literal notranslate"><span class="pre">ModuleFinder</span></code></a> class that can be used to determine
  173. the set of modules imported by a script. <code class="docutils literal notranslate"><span class="pre">modulefinder.py</span></code> can also be run as
  174. a script, giving the filename of a Python script as its argument, after which a
  175. report of the imported modules will be printed.</p>
  176. <dl class="py function">
  177. <dt class="sig sig-object py" id="modulefinder.AddPackagePath">
  178. <span class="sig-prename descclassname"><span class="pre">modulefinder.</span></span><span class="sig-name descname"><span class="pre">AddPackagePath</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">pkg_name</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">path</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#modulefinder.AddPackagePath" title="Link to this definition">¶</a></dt>
  179. <dd><p>Record that the package named <em>pkg_name</em> can be found in the specified <em>path</em>.</p>
  180. </dd></dl>
  181. <dl class="py function">
  182. <dt class="sig sig-object py" id="modulefinder.ReplacePackage">
  183. <span class="sig-prename descclassname"><span class="pre">modulefinder.</span></span><span class="sig-name descname"><span class="pre">ReplacePackage</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">oldname</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">newname</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#modulefinder.ReplacePackage" title="Link to this definition">¶</a></dt>
  184. <dd><p>Allows specifying that the module named <em>oldname</em> is in fact the package named
  185. <em>newname</em>.</p>
  186. </dd></dl>
  187. <dl class="py class">
  188. <dt class="sig sig-object py" id="modulefinder.ModuleFinder">
  189. <em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">modulefinder.</span></span><span class="sig-name descname"><span class="pre">ModuleFinder</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">path</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">debug</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">excludes</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">[]</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">replace_paths</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">[]</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#modulefinder.ModuleFinder" title="Link to this definition">¶</a></dt>
  190. <dd><p>This class provides <a class="reference internal" href="#modulefinder.ModuleFinder.run_script" title="modulefinder.ModuleFinder.run_script"><code class="xref py py-meth docutils literal notranslate"><span class="pre">run_script()</span></code></a> and <a class="reference internal" href="#modulefinder.ModuleFinder.report" title="modulefinder.ModuleFinder.report"><code class="xref py py-meth docutils literal notranslate"><span class="pre">report()</span></code></a> methods to determine
  191. the set of modules imported by a script. <em>path</em> can be a list of directories to
  192. search for modules; if not specified, <code class="docutils literal notranslate"><span class="pre">sys.path</span></code> is used. <em>debug</em> sets the
  193. debugging level; higher values make the class print debugging messages about
  194. what it’s doing. <em>excludes</em> is a list of module names to exclude from the
  195. analysis. <em>replace_paths</em> is a list of <code class="docutils literal notranslate"><span class="pre">(oldpath,</span> <span class="pre">newpath)</span></code> tuples that will
  196. be replaced in module paths.</p>
  197. <dl class="py method">
  198. <dt class="sig sig-object py" id="modulefinder.ModuleFinder.report">
  199. <span class="sig-name descname"><span class="pre">report</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#modulefinder.ModuleFinder.report" title="Link to this definition">¶</a></dt>
  200. <dd><p>Print a report to standard output that lists the modules imported by the
  201. script and their paths, as well as modules that are missing or seem to be
  202. missing.</p>
  203. </dd></dl>
  204. <dl class="py method">
  205. <dt class="sig sig-object py" id="modulefinder.ModuleFinder.run_script">
  206. <span class="sig-name descname"><span class="pre">run_script</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">pathname</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#modulefinder.ModuleFinder.run_script" title="Link to this definition">¶</a></dt>
  207. <dd><p>Analyze the contents of the <em>pathname</em> file, which must contain Python
  208. code.</p>
  209. </dd></dl>
  210. <dl class="py attribute">
  211. <dt class="sig sig-object py" id="modulefinder.ModuleFinder.modules">
  212. <span class="sig-name descname"><span class="pre">modules</span></span><a class="headerlink" href="#modulefinder.ModuleFinder.modules" title="Link to this definition">¶</a></dt>
  213. <dd><p>A dictionary mapping module names to modules. See
  214. <a class="reference internal" href="#modulefinder-example"><span class="std std-ref">Example usage of ModuleFinder</span></a>.</p>
  215. </dd></dl>
  216. </dd></dl>
  217. <section id="example-usage-of-modulefinder">
  218. <span id="modulefinder-example"></span><h2>Example usage of <a class="reference internal" href="#modulefinder.ModuleFinder" title="modulefinder.ModuleFinder"><code class="xref py py-class docutils literal notranslate"><span class="pre">ModuleFinder</span></code></a><a class="headerlink" href="#example-usage-of-modulefinder" title="Link to this heading">¶</a></h2>
  219. <p>The script that is going to get analyzed later on (bacon.py):</p>
  220. <div class="highlight-python3 notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">re</span><span class="o">,</span> <span class="nn">itertools</span>
  221. <span class="k">try</span><span class="p">:</span>
  222. <span class="kn">import</span> <span class="nn">baconhameggs</span>
  223. <span class="k">except</span> <span class="ne">ImportError</span><span class="p">:</span>
  224. <span class="k">pass</span>
  225. <span class="k">try</span><span class="p">:</span>
  226. <span class="kn">import</span> <span class="nn">guido.python.ham</span>
  227. <span class="k">except</span> <span class="ne">ImportError</span><span class="p">:</span>
  228. <span class="k">pass</span>
  229. </pre></div>
  230. </div>
  231. <p>The script that will output the report of bacon.py:</p>
  232. <div class="highlight-python3 notranslate"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">modulefinder</span> <span class="kn">import</span> <span class="n">ModuleFinder</span>
  233. <span class="n">finder</span> <span class="o">=</span> <span class="n">ModuleFinder</span><span class="p">()</span>
  234. <span class="n">finder</span><span class="o">.</span><span class="n">run_script</span><span class="p">(</span><span class="s1">&#39;bacon.py&#39;</span><span class="p">)</span>
  235. <span class="nb">print</span><span class="p">(</span><span class="s1">&#39;Loaded modules:&#39;</span><span class="p">)</span>
  236. <span class="k">for</span> <span class="n">name</span><span class="p">,</span> <span class="n">mod</span> <span class="ow">in</span> <span class="n">finder</span><span class="o">.</span><span class="n">modules</span><span class="o">.</span><span class="n">items</span><span class="p">():</span>
  237. <span class="nb">print</span><span class="p">(</span><span class="s1">&#39;</span><span class="si">%s</span><span class="s1">: &#39;</span> <span class="o">%</span> <span class="n">name</span><span class="p">,</span> <span class="n">end</span><span class="o">=</span><span class="s1">&#39;&#39;</span><span class="p">)</span>
  238. <span class="nb">print</span><span class="p">(</span><span class="s1">&#39;,&#39;</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="nb">list</span><span class="p">(</span><span class="n">mod</span><span class="o">.</span><span class="n">globalnames</span><span class="o">.</span><span class="n">keys</span><span class="p">())[:</span><span class="mi">3</span><span class="p">]))</span>
  239. <span class="nb">print</span><span class="p">(</span><span class="s1">&#39;-&#39;</span><span class="o">*</span><span class="mi">50</span><span class="p">)</span>
  240. <span class="nb">print</span><span class="p">(</span><span class="s1">&#39;Modules not imported:&#39;</span><span class="p">)</span>
  241. <span class="nb">print</span><span class="p">(</span><span class="s1">&#39;</span><span class="se">\n</span><span class="s1">&#39;</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">finder</span><span class="o">.</span><span class="n">badmodules</span><span class="o">.</span><span class="n">keys</span><span class="p">()))</span>
  242. </pre></div>
  243. </div>
  244. <p>Sample output (may vary depending on the architecture):</p>
  245. <div class="highlight-python3 notranslate"><div class="highlight"><pre><span></span><span class="n">Loaded</span> <span class="n">modules</span><span class="p">:</span>
  246. <span class="n">_types</span><span class="p">:</span>
  247. <span class="n">copyreg</span><span class="p">:</span> <span class="n">_inverted_registry</span><span class="p">,</span><span class="n">_slotnames</span><span class="p">,</span><span class="n">__all__</span>
  248. <span class="n">re</span><span class="o">.</span><span class="n">_compiler</span><span class="p">:</span> <span class="n">isstring</span><span class="p">,</span><span class="n">_sre</span><span class="p">,</span><span class="n">_optimize_unicode</span>
  249. <span class="n">_sre</span><span class="p">:</span>
  250. <span class="n">re</span><span class="o">.</span><span class="n">_constants</span><span class="p">:</span> <span class="n">REPEAT_ONE</span><span class="p">,</span><span class="n">makedict</span><span class="p">,</span><span class="n">AT_END_LINE</span>
  251. <span class="n">sys</span><span class="p">:</span>
  252. <span class="n">re</span><span class="p">:</span> <span class="vm">__module__</span><span class="p">,</span><span class="n">finditer</span><span class="p">,</span><span class="n">_expand</span>
  253. <span class="n">itertools</span><span class="p">:</span>
  254. <span class="n">__main__</span><span class="p">:</span> <span class="n">re</span><span class="p">,</span><span class="n">itertools</span><span class="p">,</span><span class="n">baconhameggs</span>
  255. <span class="n">re</span><span class="o">.</span><span class="n">_parser</span><span class="p">:</span> <span class="n">_PATTERNENDERS</span><span class="p">,</span><span class="n">SRE_FLAG_UNICODE</span>
  256. <span class="n">array</span><span class="p">:</span>
  257. <span class="n">types</span><span class="p">:</span> <span class="vm">__module__</span><span class="p">,</span><span class="n">IntType</span><span class="p">,</span><span class="n">TypeType</span>
  258. <span class="o">---------------------------------------------------</span>
  259. <span class="n">Modules</span> <span class="ow">not</span> <span class="n">imported</span><span class="p">:</span>
  260. <span class="n">guido</span><span class="o">.</span><span class="n">python</span><span class="o">.</span><span class="n">ham</span>
  261. <span class="n">baconhameggs</span>
  262. </pre></div>
  263. </div>
  264. </section>
  265. </section>
  266. <div class="clearer"></div>
  267. </div>
  268. </div>
  269. </div>
  270. <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
  271. <div class="sphinxsidebarwrapper">
  272. <div>
  273. <h3><a href="../contents.html">Table of Contents</a></h3>
  274. <ul>
  275. <li><a class="reference internal" href="#"><code class="xref py py-mod docutils literal notranslate"><span class="pre">modulefinder</span></code> — Find modules used by a script</a><ul>
  276. <li><a class="reference internal" href="#example-usage-of-modulefinder">Example usage of <code class="xref py py-class docutils literal notranslate"><span class="pre">ModuleFinder</span></code></a></li>
  277. </ul>
  278. </li>
  279. </ul>
  280. </div>
  281. <div>
  282. <h4>Previous topic</h4>
  283. <p class="topless"><a href="pkgutil.html"
  284. title="previous chapter"><code class="xref py py-mod docutils literal notranslate"><span class="pre">pkgutil</span></code> — Package extension utility</a></p>
  285. </div>
  286. <div>
  287. <h4>Next topic</h4>
  288. <p class="topless"><a href="runpy.html"
  289. title="next chapter"><code class="xref py py-mod docutils literal notranslate"><span class="pre">runpy</span></code> — Locating and executing Python modules</a></p>
  290. </div>
  291. <div role="note" aria-label="source link">
  292. <h3>This Page</h3>
  293. <ul class="this-page-menu">
  294. <li><a href="../bugs.html">Report a Bug</a></li>
  295. <li>
  296. <a href="https://github.com/python/cpython/blob/main/Doc/library/modulefinder.rst"
  297. rel="nofollow">Show Source
  298. </a>
  299. </li>
  300. </ul>
  301. </div>
  302. </div>
  303. <div id="sidebarbutton" title="Collapse sidebar">
  304. <span>«</span>
  305. </div>
  306. </div>
  307. <div class="clearer"></div>
  308. </div>
  309. <div class="related" role="navigation" aria-label="related navigation">
  310. <h3>Navigation</h3>
  311. <ul>
  312. <li class="right" style="margin-right: 10px">
  313. <a href="../genindex.html" title="General Index"
  314. >index</a></li>
  315. <li class="right" >
  316. <a href="../py-modindex.html" title="Python Module Index"
  317. >modules</a> |</li>
  318. <li class="right" >
  319. <a href="runpy.html" title="runpy — Locating and executing Python modules"
  320. >next</a> |</li>
  321. <li class="right" >
  322. <a href="pkgutil.html" title="pkgutil — Package extension utility"
  323. >previous</a> |</li>
  324. <li><img src="../_static/py.svg" alt="Python logo" style="vertical-align: middle; margin-top: -1px"/></li>
  325. <li><a href="https://www.python.org/">Python</a> &#187;</li>
  326. <li class="switchers">
  327. <div class="language_switcher_placeholder"></div>
  328. <div class="version_switcher_placeholder"></div>
  329. </li>
  330. <li>
  331. </li>
  332. <li id="cpython-language-and-version">
  333. <a href="../index.html">3.12.3 Documentation</a> &#187;
  334. </li>
  335. <li class="nav-item nav-item-1"><a href="index.html" >The Python Standard Library</a> &#187;</li>
  336. <li class="nav-item nav-item-2"><a href="modules.html" >Importing Modules</a> &#187;</li>
  337. <li class="nav-item nav-item-this"><a href=""><code class="xref py py-mod docutils literal notranslate"><span class="pre">modulefinder</span></code> — Find modules used by a script</a></li>
  338. <li class="right">
  339. <div class="inline-search" role="search">
  340. <form class="inline-search" action="../search.html" method="get">
  341. <input placeholder="Quick search" aria-label="Quick search" type="search" name="q" id="search-box" />
  342. <input type="submit" value="Go" />
  343. </form>
  344. </div>
  345. |
  346. </li>
  347. <li class="right">
  348. <label class="theme-selector-label">
  349. Theme
  350. <select class="theme-selector" oninput="activateTheme(this.value)">
  351. <option value="auto" selected>Auto</option>
  352. <option value="light">Light</option>
  353. <option value="dark">Dark</option>
  354. </select>
  355. </label> |</li>
  356. </ul>
  357. </div>
  358. <div class="footer">
  359. &copy;
  360. <a href="../copyright.html">
  361. Copyright
  362. </a>
  363. 2001-2024, Python Software Foundation.
  364. <br />
  365. This page is licensed under the Python Software Foundation License Version 2.
  366. <br />
  367. Examples, recipes, and other code in the documentation are additionally licensed under the Zero Clause BSD License.
  368. <br />
  369. See <a href="/license.html">History and License</a> for more information.<br />
  370. <br />
  371. The Python Software Foundation is a non-profit corporation.
  372. <a href="https://www.python.org/psf/donations/">Please donate.</a>
  373. <br />
  374. <br />
  375. Last updated on Apr 09, 2024 (13:47 UTC).
  376. <a href="/bugs.html">Found a bug</a>?
  377. <br />
  378. Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 7.2.6.
  379. </div>
  380. </body>
  381. </html>
上海开阖软件有限公司 沪ICP备12045867号-1