1. Installation
Official website Download: https://www.python.org/
Please select 2. X version
2. Open python from the command prompt
Just enter Python directly and click Enter
View Python version input python-v
WIN10 Open a command prompt: Win+x then press A, where Win+x is the System shortcut menu, right-click Win is also the System shortcut menu.
Set Environment variables (add environment variables that tells the operating system where to specify the path of an EXE):
Right-click win Select control Panel → top right category select ' big icon ' → system → advanced system settings → bottom right corner of environment variable → new → variable name fill python→ variable value fill path → OK
3. Exit Python at the command prompt
CTRL + Z
4. Editor Selection
The official website downloads the integrated development environment idle
Do not select Notepad, cannot be highlighted in syntax, cannot be indented
Use Vim or emacs under Linux
5. Integrated development environment New source file in idle
CTRL + N
6. Running the source file
Ctrl+f5
7. Run the source file at the command prompt
Enter CD space + the parent path where the file is located
Enter Python space + file name
8. The first two characters of the source file are #! , followed by a program. This line tells your Linux/unix system which interpreter to run when you execute your program
#!/usr/bin/python
#
Any content that is to the right of the # symbol is a comment
9. Get Help information
Use the Help () function
Example: Getting help with str: Assist (STR)
Special case: Get help with Roll-out print: Assist (' print ')
Python Usage Basics (WIN10)