freebsd下之简单安装python

先su到root帐户

进入/usr/ports/lang/python26

然后直接make

 

 

 

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

然后make install

又是漫长的等待...

 

出现Install them as needed.
====
--------------------------------------------------------
This package was built with the experimental POSIX
semaphore support. Please ensure that the kernel on the
system where you deploy this package is either compiled
with 'option P1003_1B_SEMAPHORES', or has the sem.ko
kernel module loaded.
--------------------------------------------------------
===>   Compressing manual pages for python26-2.6.1_2
===>   Running ldconfig
/sbin/ldconfig -m /usr/local/lib
===>   Registering installation for python26-2.6.1_2
hwt#

 

恭喜,安装成功

 然后输入hwt# python

进入如下python开发环境
Python 2.5.4 (r254:67916, Apr 13 2009, 18:09:11) 
[GCC 4.2.1 20070719  [FreeBSD]] on freebsd7
Type "help", "copyright", "credits" or "license" for more information.
>>>

 本文转载:http://www.cnblogs.com/yzhxhwt/archive/2009/11/07/1597850.html

输入print 'hello money'

出现

>>> print 'hello money'
hello money
>>>

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

 

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

>>> a,b=1,2
>>> a,b=b,a
>>> a,b
(2, 1)
>>>

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值