<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                ### 導航 - [索引](../genindex.xhtml "總目錄") - [模塊](../py-modindex.xhtml "Python 模塊索引") | - [下一頁](windows.xhtml "3. 在Windows上使用 Python") | - [上一頁](cmdline.xhtml "1. 命令行與環境") | - ![](https://box.kancloud.cn/a721fc7ec672275e257bbbfde49a4d4e_16x16.png) - [Python](https://www.python.org/) ? - zh\_CN 3.7.3 [文檔](../index.xhtml) ? - [安裝和使用 Python](index.xhtml) ? - $('.inline-search').show(0); | # 2. 在Unix平臺中使用Python ## 2.1. 獲取最新版本的Python ### 2.1.1. 在Linux中 Python預裝在大多數Linux發行版上,并作為一個包提供給所有其他用戶。 但是,您可能想要使用的某些功能在發行版提供的軟件包中不可用。這時您可以從源代碼輕松編譯最新版本的Python。 如果Python沒有預先安裝并且不在發行版提供的庫中,您可以輕松地為自己使用的發行版創建包。 參閱以下鏈接: 參見 <https://www.debian.org/doc/manuals/maint-guide/first.en.html>對于Debian用戶 <https://en.opensuse.org/Portal:Packaging>對于OpenSuse用戶 [https://docs-old.fedoraproject.org/en-US/Fedora\_Draft\_Documentation/0.1/html/RPM\_Guide/ch-creating-rpms.html](https://docs-old.fedoraproject.org/en-US/Fedora_Draft_Documentation/0.1/html/RPM_Guide/ch-creating-rpms.html)對于Fedora用戶 <http://www.slackbook.org/html/package-management-making-packages.html>對于Slackware用戶 ### 2.1.2. 在FreeBSD和OpenBSD上 - FreeBSD用戶,使用以下命令添加包: ``` pkg install python3 ``` - OpenBSD用戶,使用以下命令添加包: ``` pkg_add -r python pkg_add ftp://ftp.openbsd.org/pub/OpenBSD/4.2/packages/<insert your architecture here>/python-<version>.tgz ``` 例如:i386用戶獲取Python 2.5.1的可用版本: ``` pkg_add ftp://ftp.openbsd.org/pub/OpenBSD/4.2/packages/i386/python-2.5.1p2.tgz ``` ### 2.1.3. 在OpenSolaris系統上 你可以從 [OpenCSW](https://www.opencsw.org/) \[https://www.opencsw.org/\] 獲取、安裝及使用各種版本的Python。比如 `pkgutil -i python27` 。 ## 2.2. 構建Python 如果你想自己編譯CPython,首先要做的是獲取 [source](https://www.python.org/downloads/source/) \[https://www.python.org/downloads/source/\] 。您可以下載最新版本的源代碼,也可以直接提取最新的 [clone](https://devguide.python.org/setup/#getting-the-source-code) \[https://devguide.python.org/setup/#getting-the-source-code\] 。 (如果你想要制作補丁,則需要克隆代碼。) 構建過程包括通常: ``` ./configure make make install ``` 注:特定Unix平臺的配置選項和注意事項通常記錄在Python源代碼樹根目錄的 [README.rst](https://github.com/python/cpython/tree/3.7/README.rst) \[https://github.com/python/cpython/tree/3.7/README.rst\] 文件中。 警告 `make install` 可以覆蓋或偽裝 `python3` 二進制文件。因此,建議使用 `make altinstall` 而不是 `make altinstall` ,因為后者只安裝了 `exec_prefix/bin/pythonversion` 。 ## 2.3. 與Python相關的路徑和文件 這取決于本地安裝慣例; `prefix` ( `${prefix}` )和 `exec_prefix` ( `${exec_prefix}` ) 取決于安裝,應解釋為GNU軟件;它們可能相同。 例如,在大多數Linux系統上,兩者的默認值是 `/usr` 。 文件/目錄 含義 `exec_prefix/bin/python3` 解釋器的推薦位置 `prefix/lib/pythonversion`, `exec_prefix/lib/pythonversion` 包含標準模塊的目錄的推薦位置 `prefix/include/pythonversion`, `exec_prefix/include/pythonversion` 包含開發Python擴展和嵌入解釋器所需的include文件的目錄的推薦位置 ## 2.4. 雜項 要在Unix上使用Python腳本,需要添加可執行權限,例如: ``` $ chmod +x script ``` 并在腳本的頂部放置一個合適的Shebang線。一個很好的選擇通常是: ``` #!/usr/bin/env python3 ``` 將在整個 `PATH` 中搜索Python解釋器。但是,某些Unix系統可能沒有 **env** 命令,因此可能需要將 `/usr/bin/python3` 硬編碼為解釋器路徑。 要在Python腳本中使用shell命令,請查看 [`subprocess`](../library/subprocess.xhtml#module-subprocess "subprocess: Subprocess management.") 模塊。 ## 2.5. 編輯器和集成開發環境 有很多支持Python編程語言的集成開發環境。大多數編輯器和集成開發環境支持語法高亮,調試工具和 [**PEP 8**](https://www.python.org/dev/peps/pep-0008) \[https://www.python.org/dev/peps/pep-0008\] 檢查。 請訪問 [Python Editors](https://wiki.python.org/moin/PythonEditors) \[https://wiki.python.org/moin/PythonEditors\] 和 [Integrated Development Environments](https://wiki.python.org/moin/IntegratedDevelopmentEnvironments) \[https://wiki.python.org/moin/IntegratedDevelopmentEnvironments\] 以獲取完整列表。 ### 導航 - [索引](../genindex.xhtml "總目錄") - [模塊](../py-modindex.xhtml "Python 模塊索引") | - [下一頁](windows.xhtml "3. 在Windows上使用 Python") | - [上一頁](cmdline.xhtml "1. 命令行與環境") | - ![](https://box.kancloud.cn/a721fc7ec672275e257bbbfde49a4d4e_16x16.png) - [Python](https://www.python.org/) ? - zh\_CN 3.7.3 [文檔](../index.xhtml) ? - [安裝和使用 Python](index.xhtml) ? - $('.inline-search').show(0); | ? [版權所有](../copyright.xhtml) 2001-2019, Python Software Foundation. Python 軟件基金會是一個非盈利組織。 [請捐助。](https://www.python.org/psf/donations/) 最后更新于 5月 21, 2019. [發現了問題](../bugs.xhtml)? 使用[Sphinx](http://sphinx.pocoo.org/)1.8.4 創建。
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看