pydev 使用模板新建代码

新建模板

使用模板创建文件

例子:

接受命令行参数: my argparse

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# -*- coding: utf-8 -*-
'''
${module} -- ${shortdesc}

${module} -- ${description}

@author: user name
@copyright: .com All rights reserved.
@contact: @email.com
@created: ${date}
'''

import sys
import os
import re
import json
import argparse
import platform

#===============================================================================
# get_args : 获得命令行参数
#===============================================================================
def get_args():
if len(sys.argv) == 1:
print ("place use:\npython3 %s -h" % sys.argv[0])
#sys.exit(0)

parser = argparse.ArgumentParser(description=u'')
parser.add_argument('--init', help=u"init default=False", default="False", choices=["True", "False"], required=True)
args = parser.parse_args()
args.init = True if args.init == "True" else False
return args

if __name__ == "__main__":
args = get_args()

类: Module: Class

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# -*- coding: utf-8 -*-
'''
${module} -- ${shortdesc}

${module} -- ${description}

@author: user name
@copyright: .com All rights reserved.
@contact: @email.com
@created: ${date}
'''

import sys
import os
import json

class ${MyClass}(${object}):
'''
${classdocs}
'''
def __init__(self, ${params}):
'''
${Constructor}
'''
${cursor}
Related post
Comment
Share
  • cherrypy

    123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263...

    cherrypy
  • Hello World

    Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using ...

    Hello World
  • install elasticsearch on linux

    Linux安装elasticsearch配置参考下载http://172.16.60.100/tools/elasticsearch/ 配置好JAVA_HOME需要jkd1.7以上版本, 配置好JAVA_HOME ES 5.3yum安...

    install elasticsearch on linux
  • flowchat

    $$E=mc^2$$ $$\sum_{i=1}^n a_i=0$$$$\sum ^ {j-1}{k=0}{\widehat{\gamma} {kj} z k } $$ $$\Gamma(z) = \int_0^\infty t^...

    flowchat
  • linux-common-comand

    linux 一些命令工具nginx basic 认证文件生成12yum install httpd-toolshtpasswd -c 生成的认证文件名 用户名 字符串搜索12grep -Ril '搜索内容' ./...

    linux-common-comand
  • cabot install

    cabot 安装环境 centos6.5 64 python: 2.7 python2.7 安装参考graphite-install-on-centos cabot安装参考https://gist.github.com/Gromph...

    cabot install
  • luigi install

    luigi 安装官方文档: http://luigi.readthedocs.io/en/latest/中文: https://github.com/17zuoye/luiti/blob/master/README.zh_CN.mar...

    luigi install
  • centos repo

    公司centos源centos源列表(翻墙): https://www.centos.org/download/mirrors/epel源列表(翻墙): https://fedoraproject.org/wiki/EPEL163源:...

    centos repo
  • graphite install on centos

    graphite 安装环境 centos6.5 64 python: 2.7公司机器: 172.16.60.139 参考客户端: graphitesend 中文文档:https://segmentfault.com/search?q...

    graphite install on centos
  • linux install nginx

    linux 安装nginx一键安装123456789101112wget http://ip/tools/nginx/nginx-1.10.2.tar.gztar -vxf nginx-1.10.2.tar.gz cd nginx-1...

    linux install nginx
Please check the comment setting in config.yml of hexo-theme-Annie!