supremmconf.py 文件源码

python
阅读 18 收藏 0 点赞 0 评论 0

项目:supremm 作者: ubccr 项目源码 文件源码
def getoptions():
    """ process comandline options """

    retdata = {"section": None, "item": None}

    opts, _ = getopt(sys.argv[1:], "s:i:h", ["section=", "item="])

    for opt in opts:
        if opt[0] in ("-s", "--section"):
            retdata['section'] = opt[1].encode("utf-8")
        if opt[0] in ("-i", "--item"):
            retdata['item'] = opt[1]
        if opt[0] in ("-h", "--help"):
            usage()
            sys.exit(0)

    if 'section' in retdata:
        return retdata

    usage()
    sys.exit(1)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号