pycharm basic configuration

Pycharm is a pretty good IDE, but it is quite uncomfortable every time you install a new environment. Various settings need to be checked again. Here I will organize some relevant settings from time to time, and also organize them according to your own needs, so as not to waste time next time. Will continue to update…

1.import red line error

When opening a project with pycharm, some red wavy lines will often appear, prompting errors, but in fact there is no problem running it, except that pycharm uses the project root directory as the path root directory when detecting the import path, so as long as Just set it up, so as not to irritate your eyes. The
file–>setting(或者ctrl+alt+s)–>project structureinterface looks like this
Insert image description here
. Then right-click on the folder you want to import as needed, and set it to source (or the shortcut Alt+S).
Insert image description here
After setting, the picture on the far right becomes the picture below, just click OK.
Insert image description here

2. Set font size

File->Settings
Insert image description here
search increase in the search box

Right click on Increase Font Size and select Add Mouse Shortcut
Insert image description here
then press Ctrl and scroll up with the mouse wheel.
Insert image description here
In the same way, you can set the font to be reduced [When setting the font to be reduced, enter decrease in the search box]

3. Automatically add file header comments

File->settings->Editor->File and Code Templates->Python Script

Add the following code:

#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : ${DATE} ${TIME}
# @Author : Moyan# @Site : ${SITE}
# @File : ${NAME}.py
# @Software: ${PRODUCT_NAME}

Guess you like

Origin blog.csdn.net/u014665013/article/details/90080492