进入设置 
File->settings->Editor->File and Code Templates->Python Script

添加以下代码:

#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : ${DATE} ${TIME}
# @Author : Devi1o
# @File : ${NAME}.py
# @Contact : devi1oroot@gmail.com

PyCharm新建File文件时自动添加头部注释_python