######
1.File->settings->Editor->File and Code Templates->Python Script
进入页面
2.添加内容
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : ${DATE} ${TIME} # @Author : yiheng # @File : ${NAME}.py # @Software: ${PRODUCT_NAME}
3.创建新文件
4. 参考变量
预定义的变量格式为${<variable_name>}
格式 | 作用效果 |
${PROJECT_NAME} | 项目名 |
${PRODUCT_NAME} | 集成开发环境 |
${NAME} | 文件名 |
${USER} | 用户名(指登录电脑的那个用户名) |
${DATE} | 当前系统的年月日 |
${TIME} | 当前系统的时分秒 |
${YEAR} | 当前年份 |
${MONTH} | 当前月份(形式:07) |
${MONTH_NAME_SHORT} | 当前月份(形式:7月) |
${MONTH_NAME_FULL} | 当前月份(形式:七月) |
${DAY} | 当天 |
${HOUR} | 当前小时 |
${MINUTE} | 当前分钟 |
${SECOND} | 当前秒钟 |
######