Pycharm As a target Python The editor is easy to configure, powerful, time-saving, and friendly to beginners. This is why the programming classroom has always recommended for novice users. Pycharm s reason.
This article we will introduce pycharm The basic usage of the editor includes the following aspects:
- Download and install
- New project flow
- Configuration Pycharm
- Python Console
- Other references
1, download and install
Pycharm provide Free community version versus Paid professional edition . Professional Edition adds some extra features such as project templates, remote development, database support, and more. Personal learning Python Using the free community version is enough.
Pycharm Community Edition: PyCharm :: Download Latest Version of PyCharm
Baidu cloud disk address: https:// pan.baidu.com/s/1bpqWA2 F
The installation process follows the prompts step by step. Pay attention to the installation path as far as possible without using Chinese or space The directory is such that some inexplicable errors are reduced during subsequent use.
2, new project
After installing the software, we started to create the first project, the interface is as follows
Left navigation bar selection Pure Python , on the right Location Select the path to the project, Interpreter Select from the drop down bar Python version , used directly here Python The installation path can be.
After the selection is completed, click Create Button to enter the interface. At this point you can create a file, as shown in the following figure:
Here we have just created Crossin-practices For example, click on the folder and click
Crossin-practices → New → Python File
Got the following result
in Name Enter the file name in one column, remember to add .py Suffixes, clicks OK Then you can start writing
Then right click on the interface → Run example
There is such a result:
For the first script to run for the first time Right click → Run example , then you can click directly on the top right or bottom left Green Triangle . As shown below:
note : When the change file is run, the triangle and shortcut keys are not automatically changed. So often run the wrong file and did not find it. So we recommend the first time you run the right button, and then use the green triangle after switching the script.
At this point, the establishment of the project, the process of running the script file has been introduced
3, configuration Pycharm
Pycharm The configuration provided is many, here are a few more important configuration
Python The coding problem has a long history, in order to avoid a pitfall, Pycharm Provides a convenient and direct solution
in IDE Encoding 、 Project Encoding 、 Property Files Used everywhere UTF-8 Encoding while adding in the header
#-*- coding: utf-8 -*
In this way, some coding pits will be avoided more or less in the later learning process.
When there are multiple versions installed on the computer, or when you need to manage the virtual environment, Project Interpreter Provides convenient management tools.
Easy to switch here Python Version, add operations such as unloading libraries.
Modify the font:
in Editor → Font Options can modify the font, adjust the font size and other functions.
Some of the most commonly used default shortcuts under windows:
Pycharm It also provides customized shortcut keys for users of different platforms. emacs 、 vim 、 vs Students can directly choose the corresponding program.
Simultaneously, Pycharm It also provides the function of custom shortcuts.
After the modification is complete, try the effect!
powerful Pycharm Provide us with easy to use breakpoint debugging features, the steps as shown below:
Briefly introduce some important button functions of the debug bar:
Resume Program : After breakpoint debugging, click the button to continue the program execution;
Step Over : In single-step execution, when subfunctions are encountered within a function, they do not enter single-step execution within a subroutine. Instead, they are executed after the execution of the subfunction. That is, the entire subroutine function is used as a step. One thing, after our simple debugging, in the absence of sub-functions is and Step Into The effect is the same (in short, the subfunction is crossed, but the subfunction is executed);
Step Into : Single-step execution, enter the sub-function and enter and continue to single-step (in short, enter the sub-function);
Step Out : When stepping into the sub-function, you can use step out to execute the rest of the sub-function and return to the previous function.
If the program fails at a certain step, the program will automatically jump to the error page, allowing us to view the error message
For more detailed information on debugging, refer to an earlier article:
In addition, PyCharm also provides a small feature for easy debugging, but hidden deeper, see:
5, Python console
For the convenience of users, Pycharm Provides another intimate feature that will Python shell Directly integrated in the software, call out as follows:
6, some online collection of tutorials (reference)
- Pycharm Official tutorial: PyCharm :: Docs &amp;amp;amp; Demos
- Pycharm toolbar window ： PyCharm 2016.3 Help
- Pycharm Skin theme and personalized settings: Pycharm skin theme and personalization
- Pycharm Replace the theme: Pycharm replacement theme – felcon’s column – blog channel -C23SDN.NET
- Shortcut keys: Pycharm shortcuts and some common settings – jihite – Blog Park
Other articles and answers:
- Benefits for the Reaching Party: Python Getting Started Guide
- How to Make a Magic Voice-activated Game with Eighteen Lines of Python Code
- What are the possible detours in the process of learning programming? What experiences can be referenced?
- How did you teach yourself Python?
- Data Analysis: What did he sing when Zhao Lei sang folk songs?
- I went to Durex’s Weibo One line of code sweeps out “dedication”
- Today, have you got the ticket?
Crossin’s Programming Classroom
- WeChat public ID: crossincode
- website: crossincode.com