【pycharm】设置pycharm python文件模板
1. 模板的相关参数
官方链接:https://www.jetbrains.com/help/pycharm/file-template-variables.html#predefined_template_variables
Variable |
Description |
---|---|
|
Current system date |
|
Current day of the month |
|
Path to the directory of the new file (relative to the project root) |
|
Dollar sign |
|
Name of the new file |
|
Current hour |
|
Current minute |
|
Current second |
|
Current month |
|
Full name of the current month (January, February, and so on) |
|
First three letters of the current month name (Jan, Feb, and so on) |
|
Name of the new entity (file, class, interface, and so on) |
|
Name of the IDE (for example, PyCharm) |
|
Name of the current project |
|
Current system time |
|
Login name of the current user |
|
Current year |
2. 设置自己的魔板
#!/usr/bin/env python # -*- coding:utf-8 -*- """ @author: your name eg: Zhang San @file: ${NAME}.py @time: ${DATE} ${TIME} @contact: your email @desc: "this is a template for pycharm, please setting for python script." """
打开 File > settings
找到模板设置的界面 Editor > File and Code Templates
复制到 python script
3. 使用模板创建文件
然后直接创建文件即可