zl程序教程

您现在的位置是:首页 >  其他

当前栏目

pycharm 默认模版 File and Code Templates

2023-03-07 09:46:16 时间

pycharm 默认的【新建】文件,格式想指定自己的一些信息,比如:编码、自己的信息、新建时间等,那么就需要改一下文件模板。

具体步骤是(我这里是 专业版,社区版未知):

1.【File】-->【Settings...】,打开设置界面

2. 在搜索框处,输入 File

3. 然后在搜出来的结果处,点击【File and Code Templates】,选择对应要建立的文件,之后就可以改新建文件的模板了

# example

#!/usr/bin/env python3
# -*- coding: utf-8 -*-

"""
@author: yinzhuoqun
@site: http://zhuoqun.info/
@email: yin@zhuoqun.info
@time: ${DATE} ${TIME}
"""

# 效果

#!/usr/bin/env python3
# -*- coding: utf-8 -*-

"""
@author: yinzhuoqun
@site: http://zhuoqun.info/
@email: yin@zhuoqun.info
@time: 2019/4/22 15:22
"""