gooderp18绿色标准版
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

361 lines
22KB

  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="Modules command-line interface (CLI)" />
  7. <meta property="og:type" content="website" />
  8. <meta property="og:url" content="https://docs.python.org/3/library/cmdline.html" />
  9. <meta property="og:site_name" content="Python documentation" />
  10. <meta property="og:description" content="The following modules have a command-line interface. ast, asyncio, base64, calendar, code, compileall, cProfile: see profile, difflib, dis, doctest, encodings.rot_13, ensurepip, filecmp, fileinput,..." />
  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="The following modules have a command-line interface. ast, asyncio, base64, calendar, code, compileall, cProfile: see profile, difflib, dis, doctest, encodings.rot_13, ensurepip, filecmp, fileinput,..." />
  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>Modules command-line interface (CLI) &#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="Superseded Modules" href="superseded.html" />
  33. <link rel="prev" title="syslog — Unix syslog library routines" href="syslog.html" />
  34. <link rel="canonical" href="https://docs.python.org/3/library/cmdline.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. <h4>Previous topic</h4>
  84. <p class="topless"><a href="syslog.html"
  85. title="previous chapter"><code class="xref py py-mod docutils literal notranslate"><span class="pre">syslog</span></code> — Unix syslog library routines</a></p>
  86. </div>
  87. <div>
  88. <h4>Next topic</h4>
  89. <p class="topless"><a href="superseded.html"
  90. title="next chapter">Superseded Modules</a></p>
  91. </div>
  92. <div role="note" aria-label="source link">
  93. <h3>This Page</h3>
  94. <ul class="this-page-menu">
  95. <li><a href="../bugs.html">Report a Bug</a></li>
  96. <li>
  97. <a href="https://github.com/python/cpython/blob/main/Doc/library/cmdline.rst"
  98. rel="nofollow">Show Source
  99. </a>
  100. </li>
  101. </ul>
  102. </div>
  103. </nav>
  104. </div>
  105. </div>
  106. <div class="related" role="navigation" aria-label="related navigation">
  107. <h3>Navigation</h3>
  108. <ul>
  109. <li class="right" style="margin-right: 10px">
  110. <a href="../genindex.html" title="General Index"
  111. accesskey="I">index</a></li>
  112. <li class="right" >
  113. <a href="../py-modindex.html" title="Python Module Index"
  114. >modules</a> |</li>
  115. <li class="right" >
  116. <a href="superseded.html" title="Superseded Modules"
  117. accesskey="N">next</a> |</li>
  118. <li class="right" >
  119. <a href="syslog.html" title="syslog — Unix syslog library routines"
  120. accesskey="P">previous</a> |</li>
  121. <li><img src="../_static/py.svg" alt="Python logo" style="vertical-align: middle; margin-top: -1px"/></li>
  122. <li><a href="https://www.python.org/">Python</a> &#187;</li>
  123. <li class="switchers">
  124. <div class="language_switcher_placeholder"></div>
  125. <div class="version_switcher_placeholder"></div>
  126. </li>
  127. <li>
  128. </li>
  129. <li id="cpython-language-and-version">
  130. <a href="../index.html">3.12.3 Documentation</a> &#187;
  131. </li>
  132. <li class="nav-item nav-item-1"><a href="index.html" accesskey="U">The Python Standard Library</a> &#187;</li>
  133. <li class="nav-item nav-item-this"><a href="">Modules command-line interface (CLI)</a></li>
  134. <li class="right">
  135. <div class="inline-search" role="search">
  136. <form class="inline-search" action="../search.html" method="get">
  137. <input placeholder="Quick search" aria-label="Quick search" type="search" name="q" id="search-box" />
  138. <input type="submit" value="Go" />
  139. </form>
  140. </div>
  141. |
  142. </li>
  143. <li class="right">
  144. <label class="theme-selector-label">
  145. Theme
  146. <select class="theme-selector" oninput="activateTheme(this.value)">
  147. <option value="auto" selected>Auto</option>
  148. <option value="light">Light</option>
  149. <option value="dark">Dark</option>
  150. </select>
  151. </label> |</li>
  152. </ul>
  153. </div>
  154. <div class="document">
  155. <div class="documentwrapper">
  156. <div class="bodywrapper">
  157. <div class="body" role="main">
  158. <section id="modules-command-line-interface-cli">
  159. <h1>Modules command-line interface (CLI)<a class="headerlink" href="#modules-command-line-interface-cli" title="Link to this heading">¶</a></h1>
  160. <p>The following modules have a command-line interface.</p>
  161. <ul class="simple">
  162. <li><p><a class="reference internal" href="ast.html#ast-cli"><span class="std std-ref">ast</span></a></p></li>
  163. <li><p><a class="reference internal" href="asyncio.html#asyncio-cli"><span class="std std-ref">asyncio</span></a></p></li>
  164. <li><p><a class="reference internal" href="base64.html#module-base64" title="base64: RFC 4648: Base16, Base32, Base64 Data Encodings; Base85 and Ascii85"><code class="xref py py-mod docutils literal notranslate"><span class="pre">base64</span></code></a></p></li>
  165. <li><p><a class="reference internal" href="calendar.html#calendar-cli"><span class="std std-ref">calendar</span></a></p></li>
  166. <li><p><a class="reference internal" href="code.html#module-code" title="code: Facilities to implement read-eval-print loops."><code class="xref py py-mod docutils literal notranslate"><span class="pre">code</span></code></a></p></li>
  167. <li><p><a class="reference internal" href="compileall.html#compileall-cli"><span class="std std-ref">compileall</span></a></p></li>
  168. <li><p><a class="reference internal" href="profile.html#module-cProfile" title="cProfile"><code class="xref py py-mod docutils literal notranslate"><span class="pre">cProfile</span></code></a>: see <a class="reference internal" href="profile.html#profile-cli"><span class="std std-ref">profile</span></a></p></li>
  169. <li><p><a class="reference internal" href="difflib.html#difflib-interface"><span class="std std-ref">difflib</span></a></p></li>
  170. <li><p><a class="reference internal" href="dis.html#dis-cli"><span class="std std-ref">dis</span></a></p></li>
  171. <li><p><a class="reference internal" href="doctest.html#module-doctest" title="doctest: Test pieces of code within docstrings."><code class="xref py py-mod docutils literal notranslate"><span class="pre">doctest</span></code></a></p></li>
  172. <li><p><code class="xref py py-mod docutils literal notranslate"><span class="pre">encodings.rot_13</span></code></p></li>
  173. <li><p><a class="reference internal" href="ensurepip.html#module-ensurepip" title="ensurepip: Bootstrapping the &quot;pip&quot; installer into an existing Python installation or virtual environment."><code class="xref py py-mod docutils literal notranslate"><span class="pre">ensurepip</span></code></a></p></li>
  174. <li><p><a class="reference internal" href="filecmp.html#module-filecmp" title="filecmp: Compare files efficiently."><code class="xref py py-mod docutils literal notranslate"><span class="pre">filecmp</span></code></a></p></li>
  175. <li><p><a class="reference internal" href="fileinput.html#module-fileinput" title="fileinput: Loop over standard input or a list of files."><code class="xref py py-mod docutils literal notranslate"><span class="pre">fileinput</span></code></a></p></li>
  176. <li><p><a class="reference internal" href="ftplib.html#module-ftplib" title="ftplib: FTP protocol client (requires sockets)."><code class="xref py py-mod docutils literal notranslate"><span class="pre">ftplib</span></code></a></p></li>
  177. <li><p><a class="reference internal" href="gzip.html#gzip-cli"><span class="std std-ref">gzip</span></a></p></li>
  178. <li><p><a class="reference internal" href="http.server.html#http-server-cli"><span class="std std-ref">http.server</span></a></p></li>
  179. <li><p><code class="xref py py-mod docutils literal notranslate"><span class="pre">idlelib</span></code></p></li>
  180. <li><p><a class="reference internal" href="inspect.html#inspect-module-cli"><span class="std std-ref">inspect</span></a></p></li>
  181. <li><p><a class="reference internal" href="json.html#json-commandline"><span class="std std-ref">json.tool</span></a></p></li>
  182. <li><p><a class="reference internal" href="mimetypes.html#module-mimetypes" title="mimetypes: Mapping of filename extensions to MIME types."><code class="xref py py-mod docutils literal notranslate"><span class="pre">mimetypes</span></code></a></p></li>
  183. <li><p><a class="reference internal" href="pdb.html#module-pdb" title="pdb: The Python debugger for interactive interpreters."><code class="xref py py-mod docutils literal notranslate"><span class="pre">pdb</span></code></a></p></li>
  184. <li><p><a class="reference internal" href="pickle.html#module-pickle" title="pickle: Convert Python objects to streams of bytes and back."><code class="xref py py-mod docutils literal notranslate"><span class="pre">pickle</span></code></a></p></li>
  185. <li><p><a class="reference internal" href="pickletools.html#pickletools-cli"><span class="std std-ref">pickletools</span></a></p></li>
  186. <li><p><a class="reference internal" href="platform.html#module-platform" title="platform: Retrieves as much platform identifying data as possible."><code class="xref py py-mod docutils literal notranslate"><span class="pre">platform</span></code></a></p></li>
  187. <li><p><a class="reference internal" href="poplib.html#module-poplib" title="poplib: POP3 protocol client (requires sockets)."><code class="xref py py-mod docutils literal notranslate"><span class="pre">poplib</span></code></a></p></li>
  188. <li><p><a class="reference internal" href="profile.html#profile-cli"><span class="std std-ref">profile</span></a></p></li>
  189. <li><p><a class="reference internal" href="profile.html#module-pstats" title="pstats: Statistics object for use with the profiler."><code class="xref py py-mod docutils literal notranslate"><span class="pre">pstats</span></code></a></p></li>
  190. <li><p><a class="reference internal" href="py_compile.html#py-compile-cli"><span class="std std-ref">py_compile</span></a></p></li>
  191. <li><p><a class="reference internal" href="pyclbr.html#module-pyclbr" title="pyclbr: Supports information extraction for a Python module browser."><code class="xref py py-mod docutils literal notranslate"><span class="pre">pyclbr</span></code></a></p></li>
  192. <li><p><a class="reference internal" href="pydoc.html#module-pydoc" title="pydoc: Documentation generator and online help system."><code class="xref py py-mod docutils literal notranslate"><span class="pre">pydoc</span></code></a></p></li>
  193. <li><p><a class="reference internal" href="quopri.html#module-quopri" title="quopri: Encode and decode files using the MIME quoted-printable encoding."><code class="xref py py-mod docutils literal notranslate"><span class="pre">quopri</span></code></a></p></li>
  194. <li><p><a class="reference internal" href="runpy.html#module-runpy" title="runpy: Locate and run Python modules without importing them first."><code class="xref py py-mod docutils literal notranslate"><span class="pre">runpy</span></code></a></p></li>
  195. <li><p><a class="reference internal" href="site.html#site-commandline"><span class="std std-ref">site</span></a></p></li>
  196. <li><p><a class="reference internal" href="sqlite3.html#sqlite3-cli"><span class="std std-ref">sqlite3</span></a></p></li>
  197. <li><p><a class="reference internal" href="sysconfig.html#sysconfig-cli"><span class="std std-ref">sysconfig</span></a></p></li>
  198. <li><p><a class="reference internal" href="tabnanny.html#module-tabnanny" title="tabnanny: Tool for detecting white space related problems in Python source files in a directory tree."><code class="xref py py-mod docutils literal notranslate"><span class="pre">tabnanny</span></code></a></p></li>
  199. <li><p><a class="reference internal" href="tarfile.html#tarfile-commandline"><span class="std std-ref">tarfile</span></a></p></li>
  200. <li><p><code class="xref py py-mod docutils literal notranslate"><span class="pre">this</span></code></p></li>
  201. <li><p><a class="reference internal" href="timeit.html#timeit-command-line-interface"><span class="std std-ref">timeit</span></a></p></li>
  202. <li><p><a class="reference internal" href="tokenize.html#tokenize-cli"><span class="std std-ref">tokenize</span></a></p></li>
  203. <li><p><a class="reference internal" href="trace.html#trace-cli"><span class="std std-ref">trace</span></a></p></li>
  204. <li><p><a class="reference internal" href="turtle.html#module-turtledemo" title="turtledemo: A viewer for example turtle scripts"><code class="xref py py-mod docutils literal notranslate"><span class="pre">turtledemo</span></code></a></p></li>
  205. <li><p><a class="reference internal" href="unittest.html#unittest-command-line-interface"><span class="std std-ref">unittest</span></a></p></li>
  206. <li><p><a class="reference internal" href="uuid.html#uuid-cli"><span class="std std-ref">uuid</span></a></p></li>
  207. <li><p><a class="reference internal" href="venv.html#module-venv" title="venv: Creation of virtual environments."><code class="xref py py-mod docutils literal notranslate"><span class="pre">venv</span></code></a></p></li>
  208. <li><p><a class="reference internal" href="webbrowser.html#module-webbrowser" title="webbrowser: Easy-to-use controller for web browsers."><code class="xref py py-mod docutils literal notranslate"><span class="pre">webbrowser</span></code></a></p></li>
  209. <li><p><a class="reference internal" href="zipapp.html#zipapp-command-line-interface"><span class="std std-ref">zipapp</span></a></p></li>
  210. <li><p><a class="reference internal" href="zipfile.html#zipfile-commandline"><span class="std std-ref">zipfile</span></a></p></li>
  211. </ul>
  212. <p>See also the <a class="reference internal" href="../using/cmdline.html#using-on-general"><span class="std std-ref">Python command-line interface</span></a>.</p>
  213. </section>
  214. <div class="clearer"></div>
  215. </div>
  216. </div>
  217. </div>
  218. <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
  219. <div class="sphinxsidebarwrapper">
  220. <div>
  221. <h4>Previous topic</h4>
  222. <p class="topless"><a href="syslog.html"
  223. title="previous chapter"><code class="xref py py-mod docutils literal notranslate"><span class="pre">syslog</span></code> — Unix syslog library routines</a></p>
  224. </div>
  225. <div>
  226. <h4>Next topic</h4>
  227. <p class="topless"><a href="superseded.html"
  228. title="next chapter">Superseded Modules</a></p>
  229. </div>
  230. <div role="note" aria-label="source link">
  231. <h3>This Page</h3>
  232. <ul class="this-page-menu">
  233. <li><a href="../bugs.html">Report a Bug</a></li>
  234. <li>
  235. <a href="https://github.com/python/cpython/blob/main/Doc/library/cmdline.rst"
  236. rel="nofollow">Show Source
  237. </a>
  238. </li>
  239. </ul>
  240. </div>
  241. </div>
  242. <div id="sidebarbutton" title="Collapse sidebar">
  243. <span>«</span>
  244. </div>
  245. </div>
  246. <div class="clearer"></div>
  247. </div>
  248. <div class="related" role="navigation" aria-label="related navigation">
  249. <h3>Navigation</h3>
  250. <ul>
  251. <li class="right" style="margin-right: 10px">
  252. <a href="../genindex.html" title="General Index"
  253. >index</a></li>
  254. <li class="right" >
  255. <a href="../py-modindex.html" title="Python Module Index"
  256. >modules</a> |</li>
  257. <li class="right" >
  258. <a href="superseded.html" title="Superseded Modules"
  259. >next</a> |</li>
  260. <li class="right" >
  261. <a href="syslog.html" title="syslog — Unix syslog library routines"
  262. >previous</a> |</li>
  263. <li><img src="../_static/py.svg" alt="Python logo" style="vertical-align: middle; margin-top: -1px"/></li>
  264. <li><a href="https://www.python.org/">Python</a> &#187;</li>
  265. <li class="switchers">
  266. <div class="language_switcher_placeholder"></div>
  267. <div class="version_switcher_placeholder"></div>
  268. </li>
  269. <li>
  270. </li>
  271. <li id="cpython-language-and-version">
  272. <a href="../index.html">3.12.3 Documentation</a> &#187;
  273. </li>
  274. <li class="nav-item nav-item-1"><a href="index.html" >The Python Standard Library</a> &#187;</li>
  275. <li class="nav-item nav-item-this"><a href="">Modules command-line interface (CLI)</a></li>
  276. <li class="right">
  277. <div class="inline-search" role="search">
  278. <form class="inline-search" action="../search.html" method="get">
  279. <input placeholder="Quick search" aria-label="Quick search" type="search" name="q" id="search-box" />
  280. <input type="submit" value="Go" />
  281. </form>
  282. </div>
  283. |
  284. </li>
  285. <li class="right">
  286. <label class="theme-selector-label">
  287. Theme
  288. <select class="theme-selector" oninput="activateTheme(this.value)">
  289. <option value="auto" selected>Auto</option>
  290. <option value="light">Light</option>
  291. <option value="dark">Dark</option>
  292. </select>
  293. </label> |</li>
  294. </ul>
  295. </div>
  296. <div class="footer">
  297. &copy;
  298. <a href="../copyright.html">
  299. Copyright
  300. </a>
  301. 2001-2024, Python Software Foundation.
  302. <br />
  303. This page is licensed under the Python Software Foundation License Version 2.
  304. <br />
  305. Examples, recipes, and other code in the documentation are additionally licensed under the Zero Clause BSD License.
  306. <br />
  307. See <a href="/license.html">History and License</a> for more information.<br />
  308. <br />
  309. The Python Software Foundation is a non-profit corporation.
  310. <a href="https://www.python.org/psf/donations/">Please donate.</a>
  311. <br />
  312. <br />
  313. Last updated on Apr 09, 2024 (13:47 UTC).
  314. <a href="/bugs.html">Found a bug</a>?
  315. <br />
  316. Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 7.2.6.
  317. </div>
  318. </body>
  319. </html>
上海开阖软件有限公司 沪ICP备12045867号-1