PyCharm版本:PyCharm 2020.2
1. 选择 File -> Settings
2. 选择 Editor -> File and Code Templates -> Files -> Python Script
编辑代码的样式,输入以下内容并保存吗,可以根据自己喜好编辑修改:
#!/usr/bin/env python
# coding=utf-8
"""
@author: danny
@license: MIT
@contact: goufaner520@outlook.com
@file: ${NAME}.py
@date: ${DATE} ${TIME}
@desc:
"""
3. 此时新建一个.py文件,表头和注释将会自动被添加。