Python curses 模块,beep() 实例源码

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

项目:lgsm-python    作者:jaredballou    | 项目源码 | 文件源码
def default_menu(self):
        submenu_items = [
                ('beep', curses.beep),
                ('flash', curses.flash),
                ('stringy', "stringgggg"),
                ]
        submenu = CursesMenuPanel(items=submenu_items, rootmenu=self)
    #return submenu
        main_menu_items = [
                ('beep', curses.beep),
                ('flash', curses.flash),
                ('submenu', submenu),
                ('submenutype', submenu.__class__.__name__),
                ('stringy', "stringgggg")
                ]
        main_menu = CursesMenuPanel(items=main_menu_items, rootmenu=self)
    return main_menu
项目:pycreate2    作者:MomsFriendlyRobotCompany    | 项目源码 | 文件源码
def run(self):
        opt = 'x'
        while True:
            self.draw(opt)
            opt = self.screen.getch()
            # curses.flushinp()  # flush input

            # arrow keys seem to send [27, 66], where the first is ESC
            # you really want the second number
            if opt == self.DOWN_KEY:
                curses.flash()
                # return
            elif opt == self.UP_KEY:
                curses.flash()
                # return
            elif opt == self.RIGHT_KEY:
                curses.flash()
                # return
            elif opt == self.LEFT_KEY:
                curses.flash()
                # return
            elif opt == self.SPACE_KEY:
                curses.flash()
            # elif opt == self.ESC_KEY or opt == ord('q'):
            elif opt == ord('q'):
                # curses.beep()
                # curses.flash()
                return
            # else:
            #   curses.flash()
            # else:
            #   self.screen.addstr(13, 30, 'key {}'.format(opt))
            # time.sleep(1)
项目:python2-tracer    作者:extremecoders-re    | 项目源码 | 文件源码
def look_out(msecs):
    curses.napms(msecs)
    if stdscr.getch() != -1:
        curses.beep()
        sys.exit(0)
项目:lib9    作者:Jumpscale    | 项目源码 | 文件源码
def whenJustBeep(self):
        curses.beep()