This article has been uploaded to personal Github repository: Cs-docs

Welcome to Star, Fork

1. Introduction

In the last article, we introduced Python, showed you how to install the Python interpreter, and recommended Pycharm, a Python developer.

Today, we will look at how to install and configure this artifact, so that our work efficiency further improve! The content of this paper is arranged as follows:

  1. Pycharm installation
  2. Pycharm configuration
  3. Pycharm plug-in
  4. How to write a program with Pycharm

2. Pycharm installation

This part mainly describes how to install Pycharm. This article uses macOS installation as an example. Please wait for other systems to install Pycharm when you are free, 😂.

The difference between the community version and the professional version is no longer said, normally speaking, we choose the community version is enough, but because I have a professional version of the account, so the following or to the professional version as an example to install, but we do not have to worry, the installation process is the same.

  1. First go to the official website to download the installation package;

  1. Double click download ok.dmgThe installation package;

  1. Drag the icon to the rightApplicationsCan;

  1. Ok, that’s it. Our Pycharm is already installed, just go to the launcher and open it;

3. The Pycharm configuration

3.1 Font and theme Settings

Open Customize -> All Settings -> Appearance & Behavior -> Appearance, and select your favorite theme and font on the right, Jetbrains Mono is a font designed by Jetbrains. For size, choose your favorite number.

The font and theme of the IDE interface are set above, and the font and theme of the code editor are set below.

Open Customize -> All Settings -> Editor -> Font and set the Font and size according to your preferences.

Open Customize -> All Settings -> Editor -> Color Scheme and select your favorite theme.

3.2 Coding Settings

Generally speaking, the default encoding for macOS is UTF-8, but not for Windows, so you need to set it.

Open Customize -> All Settings -> Editor -> File Encodings and set everything in the right border to UTF-8.

3.3 Development template Settings

Templates are a common format. If you set the templates in Pycharm, they will be automatically included when you create a Python file.

Open Customize -> All Settings -> Editor -> File and Code Templates, select Python Script, and fill the right border with your own custom Templates. The same is true if you want to set templates for other files.

Then each time we create a Python file in the future, the template content above will be pre-defined.

3.4 plug-in

Although Pycharm is already 🐂🍺, it also has the advantage of being able to extend plug-ins. We can make Pycharm even more fun to use with the plugin. If we compare Pycharm to the hero in King of Glory, then the plugin is like a red and blue Buff that makes our hero even better. Next, let me recommend a few plug-ins that I often use.

First, if we’re going to use plug-ins, we need to know how to install them.

Go to Customize -> All Settings ->Plugins and type in the right box to search for the desired plug-in. When you find the result, click Install.

  1. Rainbow Brackets

Rainbow, as the name suggests, is all you need to do to highlight your code blocks. You may already be confused by the number of parentheses in your code, but with this you don’t have to worry about it anymore.

  1. Material Theme UI

The Material Theme UI is a plug-in for JetBrains IDE (IntelliJ IDEA, WebStorm, Android Studio, etc.) that changes the original look to the Material Design look. Originally inspired by Sublime Text’s Material Theme, this plugin provides a full set of Settings to tweak your IDE the way you want to make it look even pretter!

  1. Key Promoter X

Key Promoter X helps you learn the necessary shortcuts while you work. When you use the mouse on the buttons in the IDE, the Key Promoter X will display the keyboard shortcuts that you should use.

  1. CodeGlance

Code minimaps like those in Sublime are embedded in the editor pane and can be used to quickly locate code;

  1. leetcode editor

As a programmer, how can you forget to brush questions when you are at leisure? This plugin allows you to directly open Leetcode questions in Pycharm. Even if you want to touch the fish during working hours, others will not be able to see that you are brushing questions.

4. Write your program with Pycharm

Now that you’ve done the above steps, you can use Pycharm to write your program. In this section, we will show you how to use Pycharm to create the simplest Hello World!

  1. First, click on the home screenNew Project;

  1. Then set the project location and configure the Python interpreter, and click on the lower right cornerCreateButton;

  1. At this point our project has been created, but at this point it is 🈳️ and has nothing, so we need to create a Python script to store our code. Click the right mouse button on the item and click in sequenceNew -> Python File;

  1. Fill in the name of your script, ⚠️ although it is not clear that can not use Chinese, but it is best not mainstream, old honest practical English is good;

  1. Now that the script file is set up, it’s time to write the code;

  1. In the code edit area or select the current script file, right-click to run, or you can use shortcut keysCtrl + Shift + F10Run;

5. To summarize

Here are the tips on Pycharm installation and configuration and how to use Pycharm. You are welcome to leave comments and discuss more advanced and interesting ways to use Pycharm. You are also welcome to join my communication group and talk with everyone!