keyboard.py 文件源码

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

项目:HPCinstall 作者: NCAR 项目源码 文件源码
def get_curses_keycodes():
    """
    Return mapping of curses key-names paired by their keycode integer value.

    :rtype: dict

    Returns dictionary of (name, code) pairs for curses keyboard constant
    values and their mnemonic name. Such as code ``260``, with the value of
    its key-name identity, ``u'KEY_LEFT'``.
    """
    _keynames = [attr for attr in dir(curses)
                 if attr.startswith('KEY_')]
    return dict(
        [(keyname, getattr(curses, keyname))
         for keyname in _keynames])
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号