如何为python定义文件模板?

时间:2013-10-15 10:09:32

标签: python pycharm

当我使用pycharm创建文件时,我希望它自动拥有以下行

from __future__ import unicode literals
import logging
from common import const

log = logging.getLogger(__name__)

有可能这样做吗?这些是所有项目文件中的公共行

1 个答案:

答案 0 :(得分:3)

这很容易做到。请按照以下步骤操作:

转到File Templates并创建一个新模板,如下所示:

enter image description here

创建新文件模板

enter image description here enter image description here

现在创建新文件

enter image description here

enter image description here

enter image description here

相关问题