Python installation, environment configuration, and IDE recommendations
Official website: https://www.python.org/
Version: 2.x and 3.x differ greatly; Python3 is not backward compatible, it is recommended not to learn 2.x version of the direct Learning 3.x version, version of the difference can be referred to the website introduction
Install under Windows
Python can be installed in a multi-system operation, the installation and environment configuration of Python under WINDOWS, (Diagram reference: Baidu Experience) installation steps are as follows:
-
- Download installation program: https://www.python.org/downloads/
- After downloading, double-click Open, select the user, the default install for all users; Click Next (Next)
- Select installation path installation, can modify the installation path, the default C disk, such as C:\PYTHON34; Click Next (Next)
- Select the custom content, * recommended to check the ADD Python.exe to Path; Click Next (Next)
- Wait for the installation and click Finish
- Double-click the Python program, enter Python under CMD, and display similar to the following to indicate successful installation
System Environment Variables : If step 4 is checked, environment variables are usually configured successfully;
If you still have problems, check my Computer-Properties-advanced-environment variables, whether the value of path contains the current Python installation directory path;
If none, append the path such as "; C:\python34" (Note that a semicolon is required ";" Paste into the value of path, and CMD again to enter Python to verify that the installation was successful
IDE recommendations
1. Vim
Vim can be said to be the best IDE in Python. Vim is an advanced text editor designed to provide the actual Unix editor ' Vi ' functionality, supporting a more complete set of features. Vim doesn't take much time to learn, and once you need a seamless programming experience, you'll integrate Vim into your workflow.
2. Eclipse with PyDev
Eclipse is a very popular IDE and has a long history. Eclipse with Pydev allows developers to create useful and interactive Web applications. PyDev is the IDE for the Eclipse development Python, supporting the development of Python,jython and IronPython.
notepad++ running Debug python
notepad++ is an open source text editor that is powerful and easy to use and supports code viewing (Python support), but cannot be run initially.
The following method is used to run the Python script using notepad++, F5 or click Run-run to eject the window
Copy and paste the following statements into the input box:
cmd/k python "$ (full_current_path)" &pause & EXIT
Shortcut keys can be set after saving (see below for explanation of the principle)
Debug and run: new Python file (. py) such as test.py, input statements such as print ("Hello World") are saved and run after running
notepad++ Program Operating principle explained:
The meaning of cmd/k is to execute the following command, and to keep the window after execution is complete. (that is, cmd means to open the Command Prompt window and run the commands behind/k-python)
cmd/k python = = start –> run –> input cmd–> input python
$ (full_current_path) means the full path of the current file, which is the notepad++ macro definition
& is to connect more than one command
Pause indicates the end of the run and waits for an arbitrary key
Exit means close the command-line window (you can omit EXIT if you use cmd/c). )
Python Learning (i) installation, environment configuration, and IDE recommendations