Python Environment setup
Python is a cross-platform programming language that can be applied to Windows, Linux, Mac OS x. You can enter the Python command from the terminal window to see if a python version of Python has been installed locally.
Python download
You can download the version you want on the website of Python. (Python official website: http://www.python.org/) You can also download the Python website documentation. (Python document: www.python.org/doc/)
Python installation
Python can be installed on different platforms, with the following methods for installing Python on different platforms:
Windows Platform Installation python:
Here are the simple steps to install Python on the Windows platform:
- Open http://www.python.org/download/in the browser.
- Select the Window platform installation package in the download list, in the package format:python-xyz.msi file, XYZ is the version number you want to install.
- To use setup python-xyz.msi, Windows systems must be supported with Microsoft Installer 2.0. Just save the installation file to your local computer, and then run it to see if your machine supports MSI. Windows XP and later versions already have MSI, and many older machines can also install MSI.
- After downloading, double-click the download package, go to the Python Installation Wizard, the installation is very simple, you just need to use the default settings always click "Next" until the installation is complete.
Unix & Linux Platform Installation Python:
Here are the simple steps to install Python on UNIX & Linux platforms:
- Open http://www.python.org/download/in the browser.
- In the download list, select the source zip package that is appropriate for unix/linux.
- Download and unzip the zip package.
- If you need to customize some options to modify modules/setup
- Execution./configure
- Make
- Make install
After the operation is complete, Python will be installed in the/usr/local/bin directory, and the Python library is installed in/USR/LOCAL/LIB/PYTHONXX,XX for the version number of the python you are using.
MAC Platform Installation Python:
The most recent Macs system comes with a python environment, and you can also download the latest version of the installation on the link http://www.python.org/download/.
Configuring Environment variables
Programs and executables can be in many directories, and these paths are probably not in the search path where the operating system provides executable files. The path is stored in an environment variable, which is a named string maintained by the operating system. These variables contain information about the available command-line interpreters and other programs. Path variable in UNIX or Windows is path (Unix case-sensitive, Windows is case-insensitive). In Mac OS, the setup process changes the Python installation path. If you need to reference Python in another directory, you must add a Python directory to the path.
Setting environment variables in Windows
Set up in the following ways:
- Right-click on "Computer" and click "Properties".
- Click on "Advanced system Settings".
- Select "Path" under the "System Variables" window and double click!
- Then in the "path" line, add the Python installation path (my C:\Python27), so later, add the path. PS: Remember, the path is separated directly by a semicolon ";"
- After the final setting is successful, on the cmd command line, enter the command "Python" and you can have the relevant display.
Run Python
There are three ways to run Python:
1. Interactive Interpreter
You can enter Python from a command-line window and start writing Python code in the interactive interpreter.
E:>python
2. Command line script
E:\python>python hello.py
3. Integrated development Environment (ide:integrated Development Environment)
You can use a graphical user interface (GUI) environment to write and run Python code. The following are recommended for use by the IDE on each platform:
- Unix: IDLE is the earliest Python IDE on UNIX.
- Windows: Pycharm is a powerful Python integrated development environment.
- Macintosh: Python's Mac can use the idle IDE, and you can download the corresponding Mac's idle on your website.
Python Learning--python Environment Building