# SOME DESCRIPTIVE TITLE. # Copyright (C) 2001-2025, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: # python-doc bot, 2025 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2025-09-22 21:56+0000\n" "PO-Revision-Date: 2025-09-22 17:56+0000\n" "Last-Translator: python-doc bot, 2025\n" "Language-Team: Chinese (China) (https://app.transifex.com/python-doc/teams/5390/zh_CN/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: zh_CN\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../using/mac.rst:6 msgid "Using Python on a Mac" msgstr "在 Mac 上使用 Python" #: ../../using/mac.rst:0 msgid "Author" msgstr "作者" #: ../../using/mac.rst:8 msgid "Bob Savage " msgstr "Bob Savage " #: ../../using/mac.rst:11 msgid "" "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 IDE and the Package Manager that are worth pointing out." msgstr "" "在运行 macOS 的 Mac 上的 Python 原则上与在其他 Unix 平台上的 Python 非常相似,但有一些额外的特性,如 IDE " "和包管理器,值得指出。" #: ../../using/mac.rst:18 msgid "Getting and Installing MacPython" msgstr "获取和安装 MacPython" #: ../../using/mac.rst:20 msgid "" "macOS since version 10.8 comes with Python 2.7 pre-installed by Apple. If " "you wish, you are invited to install the most recent version of Python 3 " "from the Python website (https://www.python.org). A current \"universal " "binary\" build of Python, which runs natively on the Mac's new Intel and " "legacy PPC CPU's, is available there." msgstr "" #: ../../using/mac.rst:26 msgid "What you get after installing is a number of things:" msgstr "你安装后得到的东西有:" #: ../../using/mac.rst:28 msgid "" "A :file:`Python 3.9` folder in your :file:`Applications` folder. In here you" " find IDLE, the development environment that is a standard part of official " "Python distributions; and PythonLauncher, which handles double-clicking " "Python scripts from the Finder." msgstr "" #: ../../using/mac.rst:33 msgid "" "A framework :file:`/Library/Frameworks/Python.framework`, which includes the" " Python executable and libraries. The installer adds this location to your " "shell path. To uninstall MacPython, you can simply remove these three " "things. A symlink to the Python executable is placed in /usr/local/bin/." msgstr "" "框架 :file:`/Library/Frameworks/Python.framework` ,包括 Python " "可执行文件和库。安装程序将此位置添加到 shell 路径。 要卸载 MacPython ,你可以简单地移除这三个项目。 Python " "可执行文件的符号链接放在 /usr/local/bin/ 中。" #: ../../using/mac.rst:38 msgid "" "The Apple-provided build of Python is installed in " ":file:`/System/Library/Frameworks/Python.framework` and " ":file:`/usr/bin/python`, respectively. You should never modify or delete " "these, as they are Apple-controlled and are used by Apple- or third-party " "software. Remember that if you choose to install a newer Python version " "from python.org, you will have two different but functional Python " "installations on your computer, so it will be important that your paths and " "usages are consistent with what you want to do." msgstr "" "Apple 提供的 Python 版本分别安装在 :file:`/System/Library/Frameworks/Python.framework`" " 和 :file:`/usr/bin/python` 中。 你永远不应修改或删除这些内容,因为它们由 Apple 控制并由 Apple " "或第三方软件使用。 请记住,如果你选择从 python.org 安装较新的 Python 版本,那么你的计算机上将安装两个不同但都有用的 Python " ",因此你的路径和用法与你想要执行的操作一致非常重要。" #: ../../using/mac.rst:46 msgid "" "IDLE includes a help menu that allows you to access Python documentation. If" " you are completely new to Python you should start reading the tutorial " "introduction in that document." msgstr "IDLE 包含一个帮助菜单,允许你访问 Python 文档。 如果您是 Python 的新手,你应该开始阅读该文档中的教程介绍。" #: ../../using/mac.rst:50 msgid "" "If you are familiar with Python on other Unix platforms you should read the " "section on running Python scripts from the Unix shell." msgstr "如果你熟悉其他 Unix 平台上的 Python ,那么你应该阅读有关从 Unix shell 运行 Python 脚本的部分。" #: ../../using/mac.rst:55 msgid "How to run a Python script" msgstr "如何运行 Python 脚本" #: ../../using/mac.rst:57 msgid "" "Your best way to get started with Python on macOS is through the IDLE " "integrated development environment, see section :ref:`ide` and use the Help " "menu when the IDE is running." msgstr "" "你在 macOS 上开始使用 Python 的最好方法是通过 IDLE 集成开发环境,参见章节 :ref:`ide` 以及在IDE运行时使用帮助菜单。" #: ../../using/mac.rst:61 msgid "" "If you want to run Python scripts from the Terminal window command line or " "from the Finder you first need an editor to create your script. macOS comes " "with a number of standard Unix command line editors, :program:`vim` and " ":program:`emacs` among them. If you want a more Mac-like editor, " ":program:`BBEdit` or :program:`TextWrangler` from Bare Bones Software (see " "http://www.barebones.com/products/bbedit/index.html) are good choices, as is" " :program:`TextMate` (see https://macromates.com/). Other editors include " ":program:`Gvim` (http://macvim-dev.github.io/macvim/) and " ":program:`Aquamacs` (http://aquamacs.org/)." msgstr "" #: ../../using/mac.rst:71 msgid "" "To run your script from the Terminal window you must make sure that " ":file:`/usr/local/bin` is in your shell search path." msgstr "要从终端窗口运行脚本,必须确保:file:`/usr/local/bin` 位于 shell 搜索路径中。" #: ../../using/mac.rst:74 msgid "To run your script from the Finder you have two options:" msgstr "要从 Finder 运行你的脚本,你有两个选择:" #: ../../using/mac.rst:76 msgid "Drag it to :program:`PythonLauncher`" msgstr "把脚本拖拽到 :program:`PythonLauncher`" #: ../../using/mac.rst:78 msgid "" "Select :program:`PythonLauncher` as the default application to open your " "script (or any .py script) through the finder Info window and double-click " "it. :program:`PythonLauncher` has various preferences to control how your " "script is launched. Option-dragging allows you to change these for one " "invocation, or use its Preferences menu to change things globally." msgstr "" "选择 :program:`PythonLauncher` 作为通过 finder Info 窗口打开脚本(或任何 .py " "脚本)的默认应用程序,然后双击脚本。 :program:`PythonLauncher` 有各种首选项来控制脚本的启动方式。 " "拖拽方式允许你为一次调用更改这些选项,或使用其“首选项”菜单全局更改内容。" #: ../../using/mac.rst:88 msgid "Running scripts with a GUI" msgstr "运行有图形界面的脚本" #: ../../using/mac.rst:90 msgid "" "With older versions of Python, there is one macOS quirk that you need to be " "aware of: programs that talk to the Aqua window manager (in other words, " "anything that has a GUI) need to be run in a special way. Use " ":program:`pythonw` instead of :program:`python` to start such scripts." msgstr "" "对于旧版本的 Python ,有一个需要注意的 macOS 特殊问题:与 Aqua 窗口管理器通信的程序(换句话说,任何有 GUI " "的程序)需要以特殊的方式运行。使用 :program:`pythonw` 而不是 :program:`python` 来启动此类脚本。" #: ../../using/mac.rst:95 msgid "" "With Python 3.9, you can use either :program:`python` or :program:`pythonw`." msgstr "对于 Python 3.9,你可以使用 :program:`python` 或者 :program:`pythonw`。" #: ../../using/mac.rst:99 msgid "Configuration" msgstr "配置" #: ../../using/mac.rst:101 msgid "" "Python on macOS honors all standard Unix environment variables such as " ":envvar:`PYTHONPATH`, but setting these variables for programs started from " "the Finder is non-standard as the Finder does not read your :file:`.profile`" " or :file:`.cshrc` at startup. You need to create a file " ":file:`~/.MacOSX/environment.plist`. See Apple's Technical Document QA1067 " "for details." msgstr "" "macOS 上的 Python 遵循所有标准的 Unix 环境变量,例如 :envvar:`PYTHONPATH` ,但是为从 Finder " "启动的程序设置这些变量是不标准的,因为 Finder 在启动时不会读取你的 :file:`.profile` 或 :file:`.cshrc` " "。你需要创建一个文件 :file:`~/.MacOSX/environment.plist` 。详情请看苹果的技术文件QA1067。" #: ../../using/mac.rst:108 msgid "" "For more information on installation Python packages in MacPython, see " "section :ref:`mac-package-manager`." msgstr "更多关于在 MacPython 中安装 Python 包的信息,参阅 :ref:`mac-package-manager` 部分。" #: ../../using/mac.rst:115 msgid "The IDE" msgstr "IDE" #: ../../using/mac.rst:117 msgid "" "MacPython ships with the standard IDLE development environment. A good " "introduction to using IDLE can be found at " "http://www.hashcollision.org/hkn/python/idle_intro/index.html." msgstr "" "MacPython 附带标准的 IDLE 开发环境。 有关使用 IDLE 的详细介绍,请访问 " "http://www.hashcollision.org/hkn/python/idle_intro/index.html 。" #: ../../using/mac.rst:125 msgid "Installing Additional Python Packages" msgstr "安装额外的 Python 包" #: ../../using/mac.rst:127 msgid "There are several methods to install additional Python packages:" msgstr "有几个方法可以安装额外的 Python 包:" #: ../../using/mac.rst:129 msgid "" "Packages can be installed via the standard Python distutils mode (``python " "setup.py install``)." msgstr "可以通过标准的 Python distutils 模式( ``python setup.py install`` )安装软件包。" #: ../../using/mac.rst:132 msgid "" "Many packages can also be installed via the :program:`setuptools` extension " "or :program:`pip` wrapper, see https://pip.pypa.io/." msgstr "" "许多包也可以通过 :program:`setuptools` 扩展或 :program:`pip` 包装器安装,请参阅 " "https://pip.pypa.io/ 。" #: ../../using/mac.rst:137 msgid "GUI Programming on the Mac" msgstr "Mac 上的图形界面编程" #: ../../using/mac.rst:139 msgid "" "There are several options for building GUI applications on the Mac with " "Python." msgstr "使用 Python 在 Mac 上构建 GUI 应用程序有多种选择。" #: ../../using/mac.rst:141 msgid "" "*PyObjC* is a Python binding to Apple's Objective-C/Cocoa framework, which " "is the foundation of most modern Mac development. Information on PyObjC is " "available from https://pypi.org/project/pyobjc/." msgstr "" "*PyObjC* 是一个 Python 到 Apple 的 Objective-C/Cocoa 框架的绑定,这是大多数现代 Mac 开发的基础。 有关 " "PyObjC 的信息,请访问 https://pypi.org/project/pyobjc/。" #: ../../using/mac.rst:145 msgid "" "The standard Python GUI toolkit is :mod:`tkinter`, based on the cross-" "platform Tk toolkit (https://www.tcl.tk). An Aqua-native version of Tk is " "bundled with OS X by Apple, and the latest version can be downloaded and " "installed from https://www.activestate.com; it can also be built from " "source." msgstr "" "标准的 Python GUI 工具包是 :mod:`tkinter` ,基于跨平台的 Tk 工具包( https://www.tcl.tk )。 " "Apple 的 OS X 捆绑了 Aqua 原生版本的 Tk ,最新版本可以从 https://www.activestate.com " "下载和安装;它也可以从源代码构建。" #: ../../using/mac.rst:150 msgid "" "*wxPython* is another popular cross-platform GUI toolkit that runs natively " "on macOS. Packages and documentation are available from " "https://www.wxpython.org." msgstr "" "*wxPython* 是另一个流行的跨平台 GUI 工具包,可以在 macOS 上原生运行。软件包和文档可从 " "https://www.wxpython.org 获取。" #: ../../using/mac.rst:153 msgid "" "*PyQt* is another popular cross-platform GUI toolkit that runs natively on " "macOS. More information can be found at " "https://riverbankcomputing.com/software/pyqt/intro." msgstr "" "*PyQt* 是另一个流行的跨平台 GUI 工具包,可以在 MacOS 上原生运行。更多信息可以在 " "https://riverbankcomputing.com/software/pyqt/intro 找到。" #: ../../using/mac.rst:159 msgid "Distributing Python Applications on the Mac" msgstr "在 Mac 上分发 Python 应用程序" #: ../../using/mac.rst:161 msgid "" "The standard tool for deploying standalone Python applications on the Mac is" " :program:`py2app`. More information on installing and using py2app can be " "found at https://pypi.org/project/py2app/." msgstr "" "在 Mac 上部署独立 Python 应用程序的标准工具是 :program:`py2app` 。关于安装和使用 py2app 的更多信息可以在 " "https://pypi.org/project/py2app/ 找到。" #: ../../using/mac.rst:167 msgid "Other Resources" msgstr "其他资源" #: ../../using/mac.rst:169 msgid "" "The MacPython mailing list is an excellent support resource for Python users" " and developers on the Mac:" msgstr "MacPython 邮件列表是 Mac 上 Python 用户和开发人员的优秀支持资源:" #: ../../using/mac.rst:172 msgid "https://www.python.org/community/sigs/current/pythonmac-sig/" msgstr "https://www.python.org/community/sigs/current/pythonmac-sig/" #: ../../using/mac.rst:174 msgid "Another useful resource is the MacPython wiki:" msgstr "另一个有用的资源是 MacPython wiki :" #: ../../using/mac.rst:176 msgid "https://wiki.python.org/moin/MacPython" msgstr "https://wiki.python.org/moin/MacPython"