Pycharm设置代码模板

设置路径:

file -->settings–>editor–>file and code templates

模板变量如下:

${PROJECT_NAME} - 当前Project名称;
${NAME} - 在创建文件的对话框中指定的文件名;
${USER} - 当前用户名;
${DATE} - 当前系统日期;
${TIME} - 当前系统时间;
${YEAR} -;
${MONTH} -;
${DAY} -;
${HOUR} - 小时;
${MINUTE} - 分钟;
${PRODUCT_NAME} - 创建文件的IDE名称;
${MONTH_NAME_SHORT} - 英文月份缩写,: Jan, Feb, etc;
${MONTH_NAME_FULL} - 英文月份全称,: January, February, etc;

模板示例

"""
__project_ = '$PROJECT_NAME'
__file_name__ = '$NAME'
__author__ = '$USER'
__time__ = '$DATE $TIME'
__product_name = ${PRODUCT_NAME}
# code is far away from bugs with the god animal protecting
    I love animals. They taste delicious.
              ┏┓      ┏┓
            ┏┛┻━━━┛┻┓
            ┃        ┃
            ┃  ┳┛  ┗┳  ┃
            ┃      ┻      ┃
            ┗━┓      ┏━┛
                ┃      ┗━━━┓
                ┃  神兽保佑    ┣┓
                ┃ 永无BUG!   ┏┛
                ┗┓┓┏━┳┓┏┛
                  ┃┫┫  ┃┫┫
                  ┗┻┛  ┗┻┛
"""

你可能感兴趣的:(pycharm)