微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Python pyparsing 模块-cStyleComment() 实例源码

Python pyparsing 模块,cStyleComment() 实例源码

我们从Python开源项目中,提取了以下1代码示例,用于说明如何使用pyparsing.cStyleComment()

项目:cmd2    作者:python-cmd2    | 项目源码 | 文件源码
def __init__(self):
        # Uncomment this line to disable Python-style comments but still allow C-style comments
        # self.commentGrammars = pyparsing.Or([pyparsing.cStyleComment])

        # Create command aliases which are shorter
        self.shortcuts.update({'ap': 'aprint', 'op': 'oprint'})

        # Make sure to call this super class __init__ *after* setting commentGrammars and/or updating shortcuts
        cmd2.Cmd.__init__(self)
        # NOTE: It is critical that the super class __init__ method be called AFTER updating certain parameters which
        # are not settable at runtime.  This includes the commentGrammars,shortcuts,multilineCommands,etc.

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐