If we want to install Python in freebsd, how can we achieve a simple operation? First, we will introduce a simple Python Installation Method for one of the applications.
First su to the root account
Enter/usr/ports/lang/Python26
Then directly make
The entire Python installation process has been compiled for a long time...
Then make install
It's a long wait...
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#
Congratulations, Python is successfully installed.
Then input hwt # Python
Enter the following Python Development Environment
- 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.
- >>>
Input print 'Hello money'
Appears
- >>> print 'hello money'
- hello money
- >>>
Congratulations, the first Python program has come out.
The third variable is not required to exchange two input values.
- >>> a,b=1,2
- >>> a,bb=b,a
- >>> a,b
- (2, 1)
- >>>
The above describes the entire process of installing Python.