您的位置:首页 > 其它

Pycharm创建文件模板

2016-02-25 23:41 399 查看
https://blog.phpgao.com/pycharm_template.html

进入File->settings->Editor->File and Code Templates->Python Script
添加以下内容:
#!/usr/bin/env python
# encoding: utf-8

#set( $SITE = "http://www.phpgao.com" )

"""
@version: ??
@author: phpergao
@license: Apache Licence
@contact: endoffight@gmail.com
@site: ${SITE}
@software: ${PRODUCT_NAME}
@file: ${NAME}.py
@time: ${DATE} ${TIME}
"""

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

本文由 老高 创作,采用 知识共享署名
3.0 中国大陆许可协议 进行许可。

可自由转载、引用,但需署名作者且注明文章出处。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: