Pycharm automatically generates file comments and function comments

Time:2021-10-25

1. Document notes

File -> settings -> Editor -> File and Code Templates -> Python Script
Pycharm provides a function of automatically generating file header comments in new files. It can automatically generate necessary information such as running environment, author and date. It is convenient to use and simple to configure.
Follow the path options in 1-5. Fill in the desired comments in 5.
My template:


# -*- encoding: utf-8 -*-
'''
@File    :   ${NAME}.py   
@Contact :   [email protected]
@License :   (C)Copyright 2018-2021
 
@Modify Time      @Author    @Version    @Desciption
------------      -------    --------    -----------
${DATE} ${TIME}   Emac.li      1.0         None
'''

2. Function notes

Automatically generate function comments, including parameters and return values.
When defining a function, enter three double quotation marks directly and press enter, for example:


def a(b,c):

On another line, enter three quotation marks and press enter


def a(b,c):
"""

result:

def a(b,c):
“””
:param b:
:param c:
:return:
“””

This is the end of this article about pycharm automatic generation of file comments and function comments. For more information about pycharm file comments and function comments, please search the previous articles of developeppaer or continue to browse the relevant articles below. I hope you will support developeppaer in the future!

Recommended Today

Kudu: introduction and architecture of Apache kudu

Summary:Kudu,Hdfs,Hbase Introduction to kudu Kudu is open source by clouderaStorage engine, low latency can be provided at the same timeRandom reading and writingAnd efficientBatch data analysisAbility, he is a fusionHdfsandHbaseA new component with a new storage component in between. Kudu and HBase HDFS comparison.png Kudu is a big data storage engine, which can be combined […]