Home > Backend Development > Python Tutorial > Detailed explanation of automatic import module of Pycharm editor skills

Detailed explanation of automatic import module of Pycharm editor skills

不言
Release: 2018-04-28 14:35:34
Original
3512 people have browsed it

This article mainly introduces the detailed explanation of the automatic import module of Pycharm editor skills. Now I share it with you and give you a reference. Let’s take a look together

We often inadvertently use some classes and modules that have not yet been imported during programming. In this case, Pycharm will help us locate the module file location and add it to the import list. , this is the so-called automatic module import function. This article introduces you to relevant information about the automatic import module of Pycharm editor skills. Friends in need can refer to it.

Preface

pycharm can easily manage Python interpreters (if multiple are installed), as well as third-party modules and packages . Pycharm is the IDE of choice for many Python developers. If you can use a tool proficiently, you will often get twice the result with half the effort, including various shortcut keys, refactoring functions, and debugging skills. Since Python is a dynamic language, it is not as convenient as a static language to automatically import package modules, but with Pycharm, it can still be very powerful.

When I usually write code, I need to reference the modules that come with the system or third-party modules, or even modules elsewhere in the project. Sometimes the code almost takes up a whole screen to import a module. , we have to drag the cursor to the top of the file, first manually import the module package name, and then go back to the bottom of the file and start writing code happily. It is very troublesome to switch back and forth in this way. One principle of development is Don't repeat yourself. Repeated tasks should be completed automatically.

In fact, we only need a simple two-step configuration to let Pycharm automatically import the module

The first step: Pycharm->Perferences- >Editor->Auto Import

Step 2: Pycharm->Perferences->Keymap

# #It’s that simple. After the setting is completed, let’s experience the effect. Import the random module, press ctrl-space (press the space bar twice), and the optional module list will automatically pop up, and you can move it up or down to switch.

Related recommendations:


Summary of Pycharm usage skills

The above is the detailed content of Detailed explanation of automatic import module of Pycharm editor skills. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template