I heard that recently Python has been included in the curriculum of primary school students, as a senior technical people, will not write Python, is simply anxious, probably this is called midlife crisis, then, since the pupils can learn, put down the posture, also to learn to write it, after all, there are skills can also beg mouth food.
Hey, feed the dog.
Python installation
Python official website: https://www.python.org/
Python Document: https://www.python.org/doc/
The following are the installation packages for each platform:
Choose oneself to install the platform, I am also silly, do not know the Mac comes with Python2.7, so installed again Python3.6, then found incredibly can be perfectly compatible,
Installing Python3
Mac Brew really is also quite easy to use, using homebrew installation, convenient and quick management, Bang Bang
brew install python3
After installing the check whether the installation is successful, enter Python3 to see if you can enter the Python3 command line, you can see the version of the Python3 I installed here is 3.6.5
$python 3
Python 3.6.5 (default, APR 2018, 14:23:58)
[GCC 4.2.1 Compatible Apple LLVM 9.1.0 (clang-902.0.39.1)] on Darwin
Type "Help", "copyright", "credits" or "license" for more information.
>>>
So how to compatible with Python2, input python2, into the Python2 command line, quite simple have wood ~
$python 2
Python 2.7.15 (default, May 1 2018, 16:44:08)
[GCC 4.2.1 Compatible Apple LLVM 9.1.0 (clang-902.0.39.1)] on Darwin
Type "Help", "copyright", "credits" or "license" for more information.
>>>
You can switch at random, like the Devil's pace ~ ~
Similarly, to use Python's Pip and other tools, only need to distinguish between PIP2 and PIP3 can be solved perfectly.
$pip 3
Usage:
PIP3 <command> [Options]
The Windows version can refer to the following link https://www.cnblogs.com/yyds/p/6080826.html, a bit more troublesome than Mac is to configure environment variables.
Python Basics-mac How to harness Python2 and Python3