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…
Article directory
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 structure
interface looks like this
. Then right-click on the folder you want to import as needed, and set it to source (or the shortcut Alt+S).
After setting, the picture on the far right becomes the picture below, just click OK.
2. Set font size
File->Settings
search increase in the search box
Right click on Increase Font Size and select Add Mouse Shortcut
then press Ctrl and scroll up with the mouse wheel.
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}