gooderp18绿色标准版
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

493 lines
27KB

  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="5. Using Python on a Mac" />
  7. <meta property="og:type" content="website" />
  8. <meta property="og:url" content="https://docs.python.org/3/using/mac.html" />
  9. <meta property="og:site_name" content="Python documentation" />
  10. <meta property="og:description" content="Author, Bob Savage < bobsavage@mac.com>,. Python on a Mac running macOS is in principle very similar to Python on any other Unix platform, but there are a number of additional features such as the ..." />
  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="Author, Bob Savage < bobsavage@mac.com>,. Python on a Mac running macOS is in principle very similar to Python on any other Unix platform, but there are a number of additional features such as the ..." />
  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>5. Using Python on a Mac &#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="6. Editors and IDEs" href="editors.html" />
  33. <link rel="prev" title="4. Using Python on Windows" href="windows.html" />
  34. <link rel="canonical" href="https://docs.python.org/3/using/mac.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="#">5. Using Python on a Mac</a><ul>
  86. <li><a class="reference internal" href="#getting-and-installing-python">5.1. Getting and Installing Python</a><ul>
  87. <li><a class="reference internal" href="#how-to-run-a-python-script">5.1.1. How to run a Python script</a></li>
  88. <li><a class="reference internal" href="#running-scripts-with-a-gui">5.1.2. Running scripts with a GUI</a></li>
  89. <li><a class="reference internal" href="#configuration">5.1.3. Configuration</a></li>
  90. </ul>
  91. </li>
  92. <li><a class="reference internal" href="#the-ide">5.2. The IDE</a></li>
  93. <li><a class="reference internal" href="#installing-additional-python-packages">5.3. Installing Additional Python Packages</a></li>
  94. <li><a class="reference internal" href="#gui-programming">5.4. GUI Programming</a></li>
  95. <li><a class="reference internal" href="#distributing-python-applications">5.5. Distributing Python Applications</a></li>
  96. <li><a class="reference internal" href="#other-resources">5.6. Other Resources</a></li>
  97. </ul>
  98. </li>
  99. </ul>
  100. </div>
  101. <div>
  102. <h4>Previous topic</h4>
  103. <p class="topless"><a href="windows.html"
  104. title="previous chapter"><span class="section-number">4. </span>Using Python on Windows</a></p>
  105. </div>
  106. <div>
  107. <h4>Next topic</h4>
  108. <p class="topless"><a href="editors.html"
  109. title="next chapter"><span class="section-number">6. </span>Editors and IDEs</a></p>
  110. </div>
  111. <div role="note" aria-label="source link">
  112. <h3>This Page</h3>
  113. <ul class="this-page-menu">
  114. <li><a href="../bugs.html">Report a Bug</a></li>
  115. <li>
  116. <a href="https://github.com/python/cpython/blob/main/Doc/using/mac.rst"
  117. rel="nofollow">Show Source
  118. </a>
  119. </li>
  120. </ul>
  121. </div>
  122. </nav>
  123. </div>
  124. </div>
  125. <div class="related" role="navigation" aria-label="related navigation">
  126. <h3>Navigation</h3>
  127. <ul>
  128. <li class="right" style="margin-right: 10px">
  129. <a href="../genindex.html" title="General Index"
  130. accesskey="I">index</a></li>
  131. <li class="right" >
  132. <a href="../py-modindex.html" title="Python Module Index"
  133. >modules</a> |</li>
  134. <li class="right" >
  135. <a href="editors.html" title="6. Editors and IDEs"
  136. accesskey="N">next</a> |</li>
  137. <li class="right" >
  138. <a href="windows.html" title="4. Using Python on Windows"
  139. accesskey="P">previous</a> |</li>
  140. <li><img src="../_static/py.svg" alt="Python logo" style="vertical-align: middle; margin-top: -1px"/></li>
  141. <li><a href="https://www.python.org/">Python</a> &#187;</li>
  142. <li class="switchers">
  143. <div class="language_switcher_placeholder"></div>
  144. <div class="version_switcher_placeholder"></div>
  145. </li>
  146. <li>
  147. </li>
  148. <li id="cpython-language-and-version">
  149. <a href="../index.html">3.12.3 Documentation</a> &#187;
  150. </li>
  151. <li class="nav-item nav-item-1"><a href="index.html" accesskey="U">Python Setup and Usage</a> &#187;</li>
  152. <li class="nav-item nav-item-this"><a href=""><span class="section-number">5. </span>Using Python on a Mac</a></li>
  153. <li class="right">
  154. <div class="inline-search" role="search">
  155. <form class="inline-search" action="../search.html" method="get">
  156. <input placeholder="Quick search" aria-label="Quick search" type="search" name="q" id="search-box" />
  157. <input type="submit" value="Go" />
  158. </form>
  159. </div>
  160. |
  161. </li>
  162. <li class="right">
  163. <label class="theme-selector-label">
  164. Theme
  165. <select class="theme-selector" oninput="activateTheme(this.value)">
  166. <option value="auto" selected>Auto</option>
  167. <option value="light">Light</option>
  168. <option value="dark">Dark</option>
  169. </select>
  170. </label> |</li>
  171. </ul>
  172. </div>
  173. <div class="document">
  174. <div class="documentwrapper">
  175. <div class="bodywrapper">
  176. <div class="body" role="main">
  177. <section id="using-python-on-a-mac">
  178. <span id="using-on-mac"></span><h1><span class="section-number">5. </span>Using Python on a Mac<a class="headerlink" href="#using-python-on-a-mac" title="Link to this heading">¶</a></h1>
  179. <dl class="field-list simple">
  180. <dt class="field-odd">Author<span class="colon">:</span></dt>
  181. <dd class="field-odd"><p>Bob Savage &lt;<a class="reference external" href="mailto:bobsavage&#37;&#52;&#48;mac&#46;com">bobsavage<span>&#64;</span>mac<span>&#46;</span>com</a>&gt;</p>
  182. </dd>
  183. </dl>
  184. <p>Python on a Mac running macOS is in principle very similar to Python on
  185. any other Unix platform, but there are a number of additional features such as
  186. the integrated development environment (IDE) and the Package Manager that are
  187. worth pointing out.</p>
  188. <section id="getting-and-installing-python">
  189. <span id="getting-and-installing-macpython"></span><span id="getting-osx"></span><h2><span class="section-number">5.1. </span>Getting and Installing Python<a class="headerlink" href="#getting-and-installing-python" title="Link to this heading">¶</a></h2>
  190. <p>macOS used to come with Python 2.7 pre-installed between versions
  191. 10.8 and <a class="reference external" href="https://developer.apple.com/documentation/macos-release-notes/macos-12_3-release-notes#Python">12.3</a>.
  192. You are invited to install the most recent version of Python 3 from the <a class="reference external" href="https://www.python.org/downloads/macos/">Python
  193. website</a>.
  194. A current “universal2 binary” build of Python, which runs natively on the Mac’s
  195. new Apple Silicon and legacy Intel processors, is available there.</p>
  196. <p>What you get after installing is a number of things:</p>
  197. <ul class="simple">
  198. <li><p>A <code class="docutils literal notranslate"><span class="pre">Python</span> <span class="pre">3.12</span></code> folder in your <code class="file docutils literal notranslate"><span class="pre">Applications</span></code> folder. In here
  199. you find IDLE, the development environment that is a standard part of official
  200. Python distributions; and <strong class="program">Python Launcher</strong>, which handles double-clicking Python
  201. scripts from the Finder.</p></li>
  202. <li><p>A framework <code class="file docutils literal notranslate"><span class="pre">/Library/Frameworks/Python.framework</span></code>, which includes the
  203. Python executable and libraries. The installer adds this location to your shell
  204. path. To uninstall Python, you can remove these three things. A
  205. symlink to the Python executable is placed in <code class="file docutils literal notranslate"><span class="pre">/usr/local/bin/</span></code>.</p></li>
  206. </ul>
  207. <div class="admonition note">
  208. <p class="admonition-title">Note</p>
  209. <p>On macOS 10.8-12.3, the Apple-provided build of Python is installed in
  210. <code class="file docutils literal notranslate"><span class="pre">/System/Library/Frameworks/Python.framework</span></code> and <code class="file docutils literal notranslate"><span class="pre">/usr/bin/python</span></code>,
  211. respectively. You should never modify or delete these, as they are
  212. Apple-controlled and are used by Apple- or third-party software. Remember that
  213. if you choose to install a newer Python version from python.org, you will have
  214. two different but functional Python installations on your computer, so it will
  215. be important that your paths and usages are consistent with what you want to do.</p>
  216. </div>
  217. <p>IDLE includes a Help menu that allows you to access Python documentation. If you
  218. are completely new to Python you should start reading the tutorial introduction
  219. in that document.</p>
  220. <p>If you are familiar with Python on other Unix platforms you should read the
  221. section on running Python scripts from the Unix shell.</p>
  222. <section id="how-to-run-a-python-script">
  223. <h3><span class="section-number">5.1.1. </span>How to run a Python script<a class="headerlink" href="#how-to-run-a-python-script" title="Link to this heading">¶</a></h3>
  224. <p>Your best way to get started with Python on macOS is through the IDLE
  225. integrated development environment; see section <a class="reference internal" href="#ide"><span class="std std-ref">The IDE</span></a> and use the Help menu
  226. when the IDE is running.</p>
  227. <p>If you want to run Python scripts from the Terminal window command line or from
  228. the Finder you first need an editor to create your script. macOS comes with a
  229. number of standard Unix command line editors, <strong class="program">vim</strong>
  230. <strong class="program">nano</strong> among them. If you want a more Mac-like editor,
  231. <strong class="program">BBEdit</strong> from Bare Bones Software (see
  232. <a class="reference external" href="https://www.barebones.com/products/bbedit/index.html">https://www.barebones.com/products/bbedit/index.html</a>) are good choices, as is
  233. <strong class="program">TextMate</strong> (see <a class="reference external" href="https://macromates.com">https://macromates.com</a>). Other editors include
  234. <strong class="program">MacVim</strong> (<a class="reference external" href="https://macvim.org">https://macvim.org</a>) and <strong class="program">Aquamacs</strong>
  235. (<a class="reference external" href="https://aquamacs.org">https://aquamacs.org</a>).</p>
  236. <p>To run your script from the Terminal window you must make sure that
  237. <code class="file docutils literal notranslate"><span class="pre">/usr/local/bin</span></code> is in your shell search path.</p>
  238. <p>To run your script from the Finder you have two options:</p>
  239. <ul class="simple">
  240. <li><p>Drag it to <strong class="program">Python Launcher</strong>.</p></li>
  241. <li><p>Select <strong class="program">Python Launcher</strong> as the default application to open your
  242. script (or any <code class="docutils literal notranslate"><span class="pre">.py</span></code> script) through the finder Info window and double-click it.
  243. <strong class="program">Python Launcher</strong> has various preferences to control how your script is
  244. launched. Option-dragging allows you to change these for one invocation, or use
  245. its Preferences menu to change things globally.</p></li>
  246. </ul>
  247. </section>
  248. <section id="running-scripts-with-a-gui">
  249. <span id="osx-gui-scripts"></span><h3><span class="section-number">5.1.2. </span>Running scripts with a GUI<a class="headerlink" href="#running-scripts-with-a-gui" title="Link to this heading">¶</a></h3>
  250. <p>With older versions of Python, there is one macOS quirk that you need to be
  251. aware of: programs that talk to the Aqua window manager (in other words,
  252. anything that has a GUI) need to be run in a special way. Use <strong class="program">pythonw</strong>
  253. instead of <strong class="program">python</strong> to start such scripts.</p>
  254. <p>With Python 3.9, you can use either <strong class="program">python</strong> or <strong class="program">pythonw</strong>.</p>
  255. </section>
  256. <section id="configuration">
  257. <h3><span class="section-number">5.1.3. </span>Configuration<a class="headerlink" href="#configuration" title="Link to this heading">¶</a></h3>
  258. <p>Python on macOS honors all standard Unix environment variables such as
  259. <span class="target" id="index-0"></span><a class="reference internal" href="cmdline.html#envvar-PYTHONPATH"><code class="xref std std-envvar docutils literal notranslate"><span class="pre">PYTHONPATH</span></code></a>, but setting these variables for programs started from the
  260. Finder is non-standard as the Finder does not read your <code class="file docutils literal notranslate"><span class="pre">.profile</span></code> or
  261. <code class="file docutils literal notranslate"><span class="pre">.cshrc</span></code> at startup. You need to create a file
  262. <code class="file docutils literal notranslate"><span class="pre">~/.MacOSX/environment.plist</span></code>. See Apple’s
  263. <a class="reference external" href="https://developer.apple.com/library/archive/qa/qa1067/_index.html">Technical Q&amp;A QA1067</a>
  264. for details.</p>
  265. <p>For more information on installation Python packages, see section
  266. <a class="reference internal" href="#mac-package-manager"><span class="std std-ref">Installing Additional Python Packages</span></a>.</p>
  267. </section>
  268. </section>
  269. <section id="the-ide">
  270. <span id="ide"></span><h2><span class="section-number">5.2. </span>The IDE<a class="headerlink" href="#the-ide" title="Link to this heading">¶</a></h2>
  271. <p>Python ships with the standard IDLE development environment. A good
  272. introduction to using IDLE can be found at
  273. <a class="reference external" href="https://www.hashcollision.org/hkn/python/idle_intro/index.html">https://www.hashcollision.org/hkn/python/idle_intro/index.html</a>.</p>
  274. </section>
  275. <section id="installing-additional-python-packages">
  276. <span id="mac-package-manager"></span><h2><span class="section-number">5.3. </span>Installing Additional Python Packages<a class="headerlink" href="#installing-additional-python-packages" title="Link to this heading">¶</a></h2>
  277. <p>This section has moved to the <a class="reference external" href="https://packaging.python.org/en/latest/tutorials/installing-packages/">Python Packaging User Guide</a>.</p>
  278. </section>
  279. <section id="gui-programming">
  280. <span id="gui-programming-on-the-mac"></span><h2><span class="section-number">5.4. </span>GUI Programming<a class="headerlink" href="#gui-programming" title="Link to this heading">¶</a></h2>
  281. <p>There are several options for building GUI applications on the Mac with Python.</p>
  282. <p><em>PyObjC</em> is a Python binding to Apple’s Objective-C/Cocoa framework, which is
  283. the foundation of most modern Mac development. Information on PyObjC is
  284. available from <a class="reference external" href="https://pypi.org/project/pyobjc/">https://pypi.org/project/pyobjc/</a>.</p>
  285. <p>The standard Python GUI toolkit is <a class="reference internal" href="../library/tkinter.html#module-tkinter" title="tkinter: Interface to Tcl/Tk for graphical user interfaces"><code class="xref py py-mod docutils literal notranslate"><span class="pre">tkinter</span></code></a>, based on the cross-platform
  286. Tk toolkit (<a class="reference external" href="https://www.tcl.tk">https://www.tcl.tk</a>). An Aqua-native version of Tk is bundled with
  287. macOS by Apple, and the latest version can be downloaded and installed from
  288. <a class="reference external" href="https://www.activestate.com">https://www.activestate.com</a>; it can also be built from source.</p>
  289. <p>A number of alternative macOS GUI toolkits are available:</p>
  290. <ul class="simple">
  291. <li><p><a class="reference external" href="https://www.qt.io/qt-for-python">PySide</a>: Official Python bindings to the
  292. <a class="reference external" href="https://qt.io">Qt GUI toolkit</a>.</p></li>
  293. <li><p><a class="reference external" href="https://riverbankcomputing.com/software/pyqt/intro">PyQt</a>: Alternative
  294. Python bindings to Qt.</p></li>
  295. <li><p><a class="reference external" href="https://kivy.org">Kivy</a>: A cross-platform GUI toolkit that supports
  296. desktop and mobile platforms.</p></li>
  297. <li><p><a class="reference external" href="https://toga.readthedocs.io">Toga</a>: Part of the <a class="reference external" href="https://beeware.org">BeeWare Project</a>; supports desktop, mobile, web and console apps.</p></li>
  298. <li><p><a class="reference external" href="https://www.wxpython.org">wxPython</a>: A cross-platform toolkit that
  299. supports desktop operating systems.</p></li>
  300. </ul>
  301. </section>
  302. <section id="distributing-python-applications">
  303. <span id="distributing-python-applications-on-the-mac"></span><h2><span class="section-number">5.5. </span>Distributing Python Applications<a class="headerlink" href="#distributing-python-applications" title="Link to this heading">¶</a></h2>
  304. <p>A range of tools exist for converting your Python code into a standalone
  305. distributable application:</p>
  306. <ul class="simple">
  307. <li><p><a class="reference external" href="https://pypi.org/project/py2app/">py2app</a>: Supports creating macOS <code class="docutils literal notranslate"><span class="pre">.app</span></code>
  308. bundles from a Python project.</p></li>
  309. <li><p><a class="reference external" href="https://briefcase.readthedocs.io">Briefcase</a>: Part of the <a class="reference external" href="https://beeware.org">BeeWare Project</a>; a cross-platform packaging tool that supports
  310. creation of <code class="docutils literal notranslate"><span class="pre">.app</span></code> bundles on macOS, as well as managing signing and
  311. notarization.</p></li>
  312. <li><p><a class="reference external" href="https://pyinstaller.org/">PyInstaller</a>: A cross-platform packaging tool that creates
  313. a single file or folder as a distributable artifact.</p></li>
  314. </ul>
  315. </section>
  316. <section id="other-resources">
  317. <h2><span class="section-number">5.6. </span>Other Resources<a class="headerlink" href="#other-resources" title="Link to this heading">¶</a></h2>
  318. <p>The Pythonmac-SIG mailing list is an excellent support resource for Python users
  319. and developers on the Mac:</p>
  320. <p><a class="reference external" href="https://www.python.org/community/sigs/current/pythonmac-sig/">https://www.python.org/community/sigs/current/pythonmac-sig/</a></p>
  321. <p>Another useful resource is the MacPython wiki:</p>
  322. <p><a class="reference external" href="https://wiki.python.org/moin/MacPython">https://wiki.python.org/moin/MacPython</a></p>
  323. </section>
  324. </section>
  325. <div class="clearer"></div>
  326. </div>
  327. </div>
  328. </div>
  329. <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
  330. <div class="sphinxsidebarwrapper">
  331. <div>
  332. <h3><a href="../contents.html">Table of Contents</a></h3>
  333. <ul>
  334. <li><a class="reference internal" href="#">5. Using Python on a Mac</a><ul>
  335. <li><a class="reference internal" href="#getting-and-installing-python">5.1. Getting and Installing Python</a><ul>
  336. <li><a class="reference internal" href="#how-to-run-a-python-script">5.1.1. How to run a Python script</a></li>
  337. <li><a class="reference internal" href="#running-scripts-with-a-gui">5.1.2. Running scripts with a GUI</a></li>
  338. <li><a class="reference internal" href="#configuration">5.1.3. Configuration</a></li>
  339. </ul>
  340. </li>
  341. <li><a class="reference internal" href="#the-ide">5.2. The IDE</a></li>
  342. <li><a class="reference internal" href="#installing-additional-python-packages">5.3. Installing Additional Python Packages</a></li>
  343. <li><a class="reference internal" href="#gui-programming">5.4. GUI Programming</a></li>
  344. <li><a class="reference internal" href="#distributing-python-applications">5.5. Distributing Python Applications</a></li>
  345. <li><a class="reference internal" href="#other-resources">5.6. Other Resources</a></li>
  346. </ul>
  347. </li>
  348. </ul>
  349. </div>
  350. <div>
  351. <h4>Previous topic</h4>
  352. <p class="topless"><a href="windows.html"
  353. title="previous chapter"><span class="section-number">4. </span>Using Python on Windows</a></p>
  354. </div>
  355. <div>
  356. <h4>Next topic</h4>
  357. <p class="topless"><a href="editors.html"
  358. title="next chapter"><span class="section-number">6. </span>Editors and IDEs</a></p>
  359. </div>
  360. <div role="note" aria-label="source link">
  361. <h3>This Page</h3>
  362. <ul class="this-page-menu">
  363. <li><a href="../bugs.html">Report a Bug</a></li>
  364. <li>
  365. <a href="https://github.com/python/cpython/blob/main/Doc/using/mac.rst"
  366. rel="nofollow">Show Source
  367. </a>
  368. </li>
  369. </ul>
  370. </div>
  371. </div>
  372. <div id="sidebarbutton" title="Collapse sidebar">
  373. <span>«</span>
  374. </div>
  375. </div>
  376. <div class="clearer"></div>
  377. </div>
  378. <div class="related" role="navigation" aria-label="related navigation">
  379. <h3>Navigation</h3>
  380. <ul>
  381. <li class="right" style="margin-right: 10px">
  382. <a href="../genindex.html" title="General Index"
  383. >index</a></li>
  384. <li class="right" >
  385. <a href="../py-modindex.html" title="Python Module Index"
  386. >modules</a> |</li>
  387. <li class="right" >
  388. <a href="editors.html" title="6. Editors and IDEs"
  389. >next</a> |</li>
  390. <li class="right" >
  391. <a href="windows.html" title="4. Using Python on Windows"
  392. >previous</a> |</li>
  393. <li><img src="../_static/py.svg" alt="Python logo" style="vertical-align: middle; margin-top: -1px"/></li>
  394. <li><a href="https://www.python.org/">Python</a> &#187;</li>
  395. <li class="switchers">
  396. <div class="language_switcher_placeholder"></div>
  397. <div class="version_switcher_placeholder"></div>
  398. </li>
  399. <li>
  400. </li>
  401. <li id="cpython-language-and-version">
  402. <a href="../index.html">3.12.3 Documentation</a> &#187;
  403. </li>
  404. <li class="nav-item nav-item-1"><a href="index.html" >Python Setup and Usage</a> &#187;</li>
  405. <li class="nav-item nav-item-this"><a href=""><span class="section-number">5. </span>Using Python on a Mac</a></li>
  406. <li class="right">
  407. <div class="inline-search" role="search">
  408. <form class="inline-search" action="../search.html" method="get">
  409. <input placeholder="Quick search" aria-label="Quick search" type="search" name="q" id="search-box" />
  410. <input type="submit" value="Go" />
  411. </form>
  412. </div>
  413. |
  414. </li>
  415. <li class="right">
  416. <label class="theme-selector-label">
  417. Theme
  418. <select class="theme-selector" oninput="activateTheme(this.value)">
  419. <option value="auto" selected>Auto</option>
  420. <option value="light">Light</option>
  421. <option value="dark">Dark</option>
  422. </select>
  423. </label> |</li>
  424. </ul>
  425. </div>
  426. <div class="footer">
  427. &copy;
  428. <a href="../copyright.html">
  429. Copyright
  430. </a>
  431. 2001-2024, Python Software Foundation.
  432. <br />
  433. This page is licensed under the Python Software Foundation License Version 2.
  434. <br />
  435. Examples, recipes, and other code in the documentation are additionally licensed under the Zero Clause BSD License.
  436. <br />
  437. See <a href="/license.html">History and License</a> for more information.<br />
  438. <br />
  439. The Python Software Foundation is a non-profit corporation.
  440. <a href="https://www.python.org/psf/donations/">Please donate.</a>
  441. <br />
  442. <br />
  443. Last updated on Apr 09, 2024 (13:47 UTC).
  444. <a href="/bugs.html">Found a bug</a>?
  445. <br />
  446. Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 7.2.6.
  447. </div>
  448. </body>
  449. </html>
上海开阖软件有限公司 沪ICP备12045867号-1