安装Python简单操作方法分享

来源:岁月联盟 编辑:zhu 时间:2010-03-28

如果我们想要在freebsd中进行一个Python的安装操作的话,应该如何做才能实现一个比较简单的操作方法呢?首先我们就在这里先为大家介绍了其中一个应用比较简单的安装Python的方法。

先su到root帐户

进入/usr/ports/lang/Python26

然后直接make

安装Python简单操作方法分享 

安装Python简单操作方法分享 

安装Python简单操作方法分享 

安装Python整个过程如图所示,经过漫长的编译之后...

然后make install

又是漫长的等待...

出现Install them as needed.

  1. ====  
  2. --------------------------------------------------------  
  3. This package was built with the experimental POSIX  
  4. semaphore support. Please ensure that the kernel on the  
  5. system where you deploy this package is either compiled  
  6. with 'option P1003_1B_SEMAPHORES', or has the sem.ko  
  7. kernel module loaded.  
  8. -------------------------------------------------------- 
  9. ===> Compressing manual pages for Python26-2.6.1_2 
  10. ===> Running ldconfig  
  11. /sbin/ldconfig -m /usr/local/lib 
  12. ===> Registering installation for Python26-2.6.1_2  
  13. hwt# 

恭喜,安装Python成功

然后输入hwt# Python

进入如下Python开发环境

  1. Python 2.5.4 (r254:67916, Apr 13 2009, 18:09:11)   
  2. [GCC 4.2.1 20070719 [FreeBSD]] on freebsd7  
  3. Type "help", "copyright", "credits" or "license" 
    for more information.  
  4. >>>  

输入print 'hello money'

出现

  1. >>> print 'hello money'  
  2. hello money  
  3. >>> 

恭喜,第一个Python程序出来了

不需要第三个变量来交换两个输入值

  1. >>> a,b=1,2  
  2. >>> a,bb=b,a  
  3. >>> a,b  
  4. (2, 1)  
  5. >>> 

以上就是对安装Python的整个过程的介绍。


图片内容