The Installation Process of Python in Linux environment: linuxpython
Compile and install
Run the command in the Python-2.7.3 root directory.
./Configure
Supplement: After the configure command is executed, a Makefile is generated, which is used by the next make command. Open Makefile and you will find that the build sequence is set in it. Linux needs to build program components according to the sequence specified by Makefile.
Make
Make actually compiles your source code and generates an execution file.
Run the make install command.
Make install
Make install actually copies the generated execution file to the necessary directory in the linux system, for example, to the/usr/local/bin directory, in this way, all users can run this program.
Python installation is complete. It should be said that, in fact, other linux software installation is similar, basically all need to go through the configure> make install process.
Hello World
After the installation is complete, run the python command. You will find that the default python command still points to the old version 2.4.3.
[Admin @ bej301441 bin] $ which python
/Usr/local/bin/python
Run the which python command and you will find that the default python is in the/usr/local/bin/python directory. In fact, the newly installed python is also in this directory.
Enter python2.7 in the command line to execute the new python version.
Create a hello. py file in Linux and write only one line of code.
Print "Hello PTIAN"
Then run python2.7 hello. py.
Enjoy... I have to admit that when I saw Python for the first time, it was moved by the efficiency of Python. No programming language ever made me feel that programming can be so pleasant...
======= EOF ==========