Pycharm在创建py文件时,自动添加文件头注释
依次
File -> Settings -> Editor -> File and Code Templates -> Python Script
添加以下代码:
# -*- coding: utf-8 -*-
# @Time : ${DATE} ${TIME}
# @Author : Herbert
# @Site : ${SITE}
# @File : ${NAME}.py
# @Software: ${PRODUCT_NAME}
![](https://images2018.cnblogs.com/blog/1402283/201809/1402283-20180911091924704-317445942.png)
参考地址:https://www.cnblogs.com/hugo07/p/5903885.html