📄 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="#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 + -