?? ch02.html
字號:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd"><html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><style type="text/css"><!--@import url(stylesheet/text.css);@import url(stylesheet/box.css);--></style><title>簡明 Python 教程 / 安裝Python / Linux和BSD用戶 </title></head><body><table width="100%"><tr><th colspan="3" align="center"><span class="header">簡明 Python 教程</span></th></tr> <th colspan="3" align="center">第2章 安裝Python</th><tr><th width="20%" align="left"><a href="ch01s04.html">上一頁</a></th><th width="60%" align="center"><span class="header2">Linux和BSD用戶</span></th><th align="right"><a href="ch02s02.html">下一頁</a></th></tr></table><hr noshade><h1>第2章 安裝Python</h1><p><strong>目錄表</strong></p><dl><dt><a href="ch02.html#s01">Linux和BSD用戶</a></dt><dt><a href="ch02s02.html">Windows®用戶</a></dt><dt><a href="ch02s03.html">概括</a></dt></dl><h1><a name="s01">Linux和BSD用戶</a></h1><p>如果你正在使用一個Linux的發行版比如Fedora或者Mandrake或者其他(你的選擇),或者一個BSD系統比如FreeBSD,那么你可能已經在你的系統里安裝了Python。</p><p>要測試你是否已經隨著你的Linux包安裝了Python,你可以打開一個shell程序(就像konsole或gnome-terminal)然后輸入如下所示的命令<strong><code>python -V</code></strong>。</p><p class="codebox"><code>$ python -V<br>Python 2.3.4</code></p><p></p><p class="notebox"><span class="boxtitle">注釋</span><br><code>$</code>是shell的提示符。根據你的操作系統的設置,它可能與你那個不同,因此我只用<code>$</code>符號表示提示符。</p><p>如果你看見向上面所示的那樣一些版本信息,那么你已經安裝了Python了。</p><p>如果你得到像這樣的消息:</p><p class="codebox"><code>$ python -V<br>bash: python: command not found</code></p><p>那么你還沒有安裝Python。這幾乎不可能,只是極其偶爾才會遇到。</p><p>在這種情況下,你有兩種方法在你的系統上安裝Python。</p><ul><li type="disc"><p>利用你的操作系統附帶的包管理軟件安裝二進制包,比如Fedora Linux的yum、Mandrake Linux的urpmi、Debian Linux的apt-get、FreeBSD的pkg_add等等。注意,使用這種方法的話,你需要連接因特網。</p><p>你也可以從別的地方下載二進制包然后拷貝到你的PC中安裝。</p></li><li type="disc"><p>你可以從<a href="http://www.python.org/download/">源代碼</a>編譯Python然后安裝。在網站上有編譯的指令。</p></li></ul><hr noshade><table width="100%"><tr><th width="20%" align="left"><a href="ch01s04.html">上一頁</a></th><th width="60%" align="center"><a href="ch02.html">上一級</a></th><th width="20%" align="right"><a href="ch02s02.html">下一頁</a></th></tr><tr><th width="20%" align="left">程序員的話</th><th width="60%" align="center"><a href="index.html">首頁</a></th><th align="right">Windows®用戶</th></tr></table></body></html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -