Pycharm创建python文件模板

作者: aries 分类: Python 发布时间: 2016-02-29 14:29 ė 2197次浏览 6 0评论

Pycharm这个IDE默认是不带python的模板的,需要我们自己创建。

进入File->settings->Editor->File and Code Templates->Python Script

添加以下内容:

#!/usr/bin/env python
# -*- coding: utf-8 -*-
#set( $SITE = "http://iw3c.com" )
# @Time    : ${DATE} ${TIME}
# @Author  : Aries (i@iw3c.com)
# @Site    : ${SITE}
# @File    : ${NAME}.py
# @Software: ${PRODUCT_NAME}

def func():
    pass
    
class Main():
    def init(self):
        pass

if name == 'main':
    pass

脚本中还可以添加自定义变量!

参考链接:

http://wiki.woodpecker.org.cn/moin/CodeCommentingRule

http://www.cnblogs.com/ziyouchutuwenwu/archive/2013/12/18/3480035.html

https://github.com/phpgao/PyCharm-Python-Templates

https://www.jetbrains.com/pycharm/webhelp/creating-and-editing-file-templates.html

http://peter-hoffmann.com/2010/python-live-templates-for-pycharm.html

https://blog.phpgao.com/pycharm_template.html

换一个
暂无评论
Ɣ回顶部