First, Python2/python3
Python2 Although the current use more, and is very mature, but it is more python3 than the congenital deficiencies. Python3 also more and more widely supported, Python3 is also the future. Officials say 2020 years later will no longer support Python2, and all updates to the latest standard library will only be updated on Python3. The biggest difference between Python2 and Python3 is the character encoding, and python3 small changes to many small details of python2, such as changes in the name of some libraries. I study at present from Python3 start, take into account python2 grammar.
PS: Of course python2.7.x is a transitional version, is a product between Python3 and Python2, some python3 is not supported by the python2.7 can be implemented.
second, Python installation
Windows
1 , download installation package https://www.python.org/downloads/2, install default installation path: \ C Python273, configure environment variable "right-click Computer"-"attribute"-"Advanced system Settings"-"Advanced"-"Environment variable"-"in the Second content box find the variable named path Row, double-click the "- " Python installation directory to append to the variable value, and split " such as: the original value; C:\python27, remember that there's a semicolon in front
Linux, Mac
no need to install, original Python environment PS: If comes with 2. 6, please update to 2. 7
Third, the choice of the editor
Currently writing Python editor countless, in the study of Baidu also searched for several more use of the editor, such as Eclipse, Atom, Pycharm. After experimenting with the self-feeling for my editor is Pycharm, it has real-time debugging is suitable for debug, the interface looks very comfortable.
About the installation and configuration of software no longer repeat, self-Baidu. The most important thing to note is the addition of the interpreter path, which will cause the program to fail to run if the addition is unsuccessful.
Iv. the first Python program
In general, the first procedure with a sense of ritual is, of course, to let the program output "helloworld! ”
# -*-coding:utf-8-*- # Author:laocai Print ('helloworld! ')
Friends who have learned other programs can see the simplicity of the Python language syntax.
Five, book recommendation
A book "Concise Python Tutorial" recommended for a completely novice is perfect for friends without any foundation, Gitbook link address:
Https://www.gitbook.com/book/lenkimo/byte-of-python-chinese-edition/details
The first Python program