安装Python简单操作方法分享
如果我们想要在freebsd中进行一个Python的安装操作的话,应该如何做才能实现一个比较简单的操作方法呢?首先我们就在这里先为大家介绍了其中一个应用比较简单的安装Python的方法。
先su到root帐户
进入/usr/ports/lang/Python26
然后直接make
安装Python整个过程如图所示,经过漫长的编译之后...
然后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#
恭喜,安装Python成功
然后输入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.- >>>
输入print 'hello money'
出现
- >>> print 'hello money'
- hello money
- >>>
恭喜,第一个Python程序出来了
不需要第三个变量来交换两个输入值
- >>> a,b=1,2
- >>> a,bb=b,a
- >>> a,b
- (2, 1)
- >>>
以上就是对安装Python的整个过程的介绍。
【编辑推荐】
- Python Helloworld程序简单实现
- Python Class正确应用代码示例剖析
- 调用Python脚本基本应用方式简述
- Python同步队列正确应用方式解析
- Python线程同步在实际应用中功能体现
版权声明:
作者:后浪云
链接:https://www.idc.net/help/403417/
文章版权归作者所有,未经允许请勿转载。
THE END