예제 #1
0
def start_game(screen: curses.window, mheight: int, mwidth: int) -> None:
    """
    function for starting a new game
    mheight: map height
    mwidth: map width
    """
    # reading player's name
    screen.clear()
    print_to_center(screen, ['Enter your name: '])
    screen.refresh()
    curses.curs_set(1)
    curses.echo()
    name = screen.getstr().decode("utf-8")
    curses.curs_set(0)
    curses.noecho()

    screen.clear()
    print_to_center(screen, ['Preparing the game...'])
    screen.refresh()

    # initializing a new game
    game = Game(mheight, mwidth)
    # making necessary preparations
    game.prepare_game(player_name=name)
    # playing the game
    play_game(screen=screen, game=game)
예제 #2
0
파일: danmu.py 프로젝트: NaviHX/pytools
def input_thread(inputw: curses.window, roomid: str):
    while True:
        msg = inputw.getstr()
        inputw.clear()

        # send msg
        send_danmu(roomid=roomid, msg=msg)
예제 #3
0
def main(s: curses.window, a, c, o):
    try:
        curses.noecho()
        s.addstr("enter password: "******"usr/beta/.private-login")
        ifdef = s.getstr().decode(encoding='utf-8')
        curses.echo()
        if ifdef == par["Info"]["PASSWORD"]:

            o.append(True)
            terminal.eval.Evaluatecommand(
                a.pop(0) + " " + ' '.join(a), "./usr/sbin", s, o)
        else:
            s.addstr("invalid password.\n")
            curses.echo()
    except Exception as we:

        s.addstr(
            "Login file not found. Please login by using the PWD utility.\n" +
            we.__str__() + "\n")