Python foundation (1)

1. The application and development of python

  The founder of python is Guido van Rossum, a Dutchman. Python was created by him to pass the time during the Christmas season of 1989. The name Python comes from Guido's beloved TV series Monty Python's Flying Circus. He hoped that the new language, called Python, would meet his vision: to create a full-featured, easy-to-learn, and extensible language between C and the shell.

  The main application scenarios of python now mainly include: web development, network programming, crawler, cloud computing, artificial intelligence, automated operation and maintenance, data analysis, game development. It is widely used in various fields and is a powerful programming language. Here I highly recommend an article from Zhihu. After reading it, I believe that it will not only give you a deep understanding of the application field of python, but also greatly enhance your determination to learn python. Deep chicken soup, highly recommended! The following is a passage from this Zhihu:

  Around 2003 or 2004, I bought a book on Python written by a Brazilian. He said that he firmly chose Python because when he was a child, he often dreamed that the future world would be ruled by a big python (python in English).
At the time, I thought this guy was so pitiful, he could even dream of such a terrifying scene in a dream. But looking at it today, maybe he was just like Anderson, a programmer in The Matrix, who accidentally traveled into the future and spied the truth of the world.


Author: li alex
Link: https://www.zhihu.com/question/22112542/answer/166053516
 

Second, the installation of python

(1), install python under the window:

First, download the 64-bit installer or 32-bit installer corresponding to Python 3 from the official website of Python according to the Windows version (64-bit or 32-bit) , and then run the downloaded EXE installation package

 

Note: Finally, check the last option, otherwise it will not run under cmd after installation, you can only add it manually

 

(2), install python under Linux

  First of all, Linux systems generally have python2 installed by default. If you want to become python3, it is not recommended to delete the original python2, because this may lead to some unknown errors. The installation steps and commands are briefly described below. Note: The following commands should be changed according to the specific installation package and the path set by yourself.

1. Install dependencies:

# yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel

2. Download the installation package:

#wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0b2.tar.xz

3. Create an empty folder as the installation location (the specific location depends on your personal preference):

# mkdir -p /usr/local/python3.7

4. Decompression

# tar xvf  Python-3.7.0b2.tar.xz

5. Enter the decompressed directory, compile and install

# cd Python-37.0b2
# ./configure --prefix=/usr/local/python3
# make && make install

6. Modify environment variables

# vim /etc/profile

  After entering, add the following two lines of code at the end. The PATH variable can be obtained by echo $PATH first, and then add: /usr/local/python3/bin at the end.

PATH=/usr/lib64/qt3.3/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin:/root/bin:/usr/local/python3.7/bin
export PATH

Restart the machine after making changes. Enter python3.7 on the command line to test it:

[root@www ~]# python3.7
Python 3.7.0b2 (default, Apr 24 2018, 21:29:20)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-18)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>

 The above >>> means the installation is successful.

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324843447&siteId=291194637