The following is a description of how to use python from three perspectives: python's own IDLE, python's command line, and the Windows command line.
I. The IDLE and shell that comes with python
1. Open the python shell from the start menu.
2. python's shell interface
3. Can be programmed and run directly from the shell.
4. Create a new python file in the shell.
5. New python file interface
6. Save the python file
7. Renaming python files
8. Running the program
9. The result is displayed in a python shell
II. Using the command line in python
1. Open the command line
2. python's command-line interface
3. Then use the same shell as in python
III. Using python on the windows command line
1. Find the python compiler location
2. Open the Win command line
3. Copy the address of the python compiler
4. Add this address to the environment variable
5. Check that the python configuration was successful
6. Run the code from the command line
Python IDLE Common Shortcuts
In the process of program development, reasonable use of shortcut keys can not only reduce the error rate of the code, but also improve the development efficiency. In IDLE, you can select "Options -> Configure IDLE" menu item, in the "Settings" dialog box opened in the 'Keys' tab. "Keys' tab of the open 'Settings' dialog box, but the interface is in English and is not easy to view. For the convenience of the reader, some common shortcut keys in IDLE are listed.
snapshot key | Explanation | Scope of application |
---|---|---|
F1 | Open the Python Help documentation | Python file windows and shells are available. |
Alt+P | Browse history commands (previous) | Available only for Python Shell windows |
Alt+N | Browse history commands (next) | Available only for Python Shell windows |
Alt+/ | Automatically completes words that have appeared before, and if there are multiple words with the same prefix, you can press the shortcut key continuously to cycle through multiple words to select them | Python file windows and shell windows are available. |
Alt+3 | commented-out block (computing) | Available only for Python file windows |
Alt+4 | Uncommenting Code Blocks | Available only for Python file windows |
Alt+g | Go to a line | Available only for Python file windows |
Ctrl+Z | Undo a step | Python file windows and shell windows are available. |
Ctrl+Shift+Z | Resume the last undo operation | Python file windows and shell windows are available. |
Ctrl+S | Save file | Python file windows and shell windows are available. |
Ctrl+] | Indented code blocks | Available only for Python file windows |
Ctrl+[ | Eliminate code block indentation | Available only for Python file windows |
Ctrl+F6 | Restart the Python Shell | Available only for Python Shell windows |
to this article on how to use python comes with IDLE several ways of the article is introduced to this, more related python comes with IDLE content please search for my previous articles or continue to browse the following related articles I hope you will support me more in the future!