Python Tutorial
Python Variable
Python Operators
Python Sequence
Python String
Python Flow Control
Python Functions
Python Class and Object
Python Class Members (properties and methods)
Python Exception Handling
Python Modules
Python File Operations (I/O)
python
command in the Terminal window to detect whether the Python development environment is installed, and which version is installed, as follows:www.iditect.com:~ mozhiyan$ python Python 2.7.10 (default, Jul 30 2016, 18:31:42) [GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.34)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>>It can be seen that the
python
command can run normally and output the version information of Python, which indicates that the current Mac OS X system already comes with Python 2.7.10. python
command points to the Python 2.x development environment by default. If you want to detect whether Python 3.x is currently installed on Mac OS X, you can enter the python3
command in the Terminal window:
command not found
, it means that Python 3.x is not installed.python3
command runs successfully and displays the version information, it means that Python 3.x has been installed.macOS 64-bit installer
is the Python installation package for Mac OS X system. Click this link and get a python-3.8.1-macosx10.9.pkg installation package after the download is complete. python
command in Terminal will enter the Python 2.x development environment. Entering the python3
command in Terminal will enter the Python 3.x development environment.www.iditect.com:~ mozhiyan$ python3 Python 3.8.1 (v3.8.1:1b293b6006, Dec 18 2019, 14:08:53) [Clang 6.0 (clang-600.0.57)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>>