文件模板

参考:

File and code templates

JetBrains提供了统一的文件模板定义方式

模板地址

点击菜单栏 -> File -> Settings...,打开系统设置

在右边侧边栏选择Editor -> File and Code Templates

模板格式

PyCharm为例,提供了许多的宏定义,参考File and Code Templates

修改Python Script如下:

# -*- coding: utf-8 -*-

"""
@date: ${DATE} ${TIME}
@file: ${NAME}.py
@author: zj
@description: 
"""

新建Python文件voc_car,生成如下内容:

# -*- coding: utf-8 -*-

"""
@date: 2020/2/29 下午2:43
@file: voc_car.py
@author: zj
@description: 
"""