当前位置: 首页>>代码示例>>Python>>正文


Python Cli.clear方法代码示例

本文整理汇总了Python中cjh.cli.Cli.clear方法的典型用法代码示例。如果您正苦于以下问题:Python Cli.clear方法的具体用法?Python Cli.clear怎么用?Python Cli.clear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在cjh.cli.Cli的用法示例。


在下文中一共展示了Cli.clear方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: main

# 需要导入模块: from cjh.cli import Cli [as 别名]
# 或者: from cjh.cli.Cli import clear [as 别名]
def main():
    """
    Main function
    """
    record = GameRecord(ARGS.filename)

    game_list = record[:]
    game_label_list = [game.label for game in game_list]

    while True:
        int_response = Cli.list_menu(Enumeration(game_label_list))
        move_list = game_list[int_response - 1][:]
        print Enumeration(move_list)

        goban = Goban(game_list[int_response - 1].header_dict['SZ'])

        color = 'black'
        for move in move_list:
            Cli.wait()
            Cli.clear()
            print goban
            goban.place_stone(move.address[0], move.address[1], color)

            if color == 'black':
                color = 'white'
            elif color == 'white':
                color = 'black'
开发者ID:hammerhorn,项目名称:hammerhorn-jive,代码行数:29,代码来源:sgf_read.py

示例2: main

# 需要导入模块: from cjh.cli import Cli [as 别名]
# 或者: from cjh.cli.Cli import clear [as 别名]
def main():
    """
    In a text environment, roll one die with or without animation,
    according to command-line flags.  In Tk, run the main loop.
    """
    if SHELL.interface == 'Tk':
        SHELL.main_window.mainloop()
    else:
        while True:
            if SHELL_NAME in ['bash', 'sh']:
                if ARGS is not None and ARGS.anim:
                    die.animate()
                else: roll_and_output()
            Cli.wait()
            Cli.clear(9)
开发者ID:hammerhorn,项目名称:hammerhorn-jive,代码行数:17,代码来源:dice.py

示例3: main

# 需要导入模块: from cjh.cli import Cli [as 别名]
# 或者: from cjh.cli.Cli import clear [as 别名]
def main():
    """
    Get stdin, echo translation to stdout.
    """
    Cli.clear()
    while True:
        words = [word.strip(".").strip().lower() for word in Cli.input().split()]
        if words == [":get-list"]:
            list_ = [w.encode("ascii") for w in list(TRANSLATE_KEY.keys())]
            print("\n{}".format(sorted(list_, key=str.lower)))  # pylint: disable=C0325
            continue
        output = ""

        for word in words:
            output += TRANSLATE_KEY[word] + " "

        print("{}.\n".format(output.encode("utf-8").capitalize().strip()))  # pylint: disable=C0325
开发者ID:hammerhorn,项目名称:hammerhorn-jive,代码行数:19,代码来源:saypyu1.py

示例4: main

# 需要导入模块: from cjh.cli import Cli [as 别名]
# 或者: from cjh.cli.Cli import clear [as 别名]
def main():
    """
    the main function
    """
    #fx_list = []

    if ARGS is not None and ARGS.quiet is False:
        SHELL.welcome(
            script_name='== simple graph calc ==',
            description='A simple text-based graphing calculator.')

    graph = _make_graph()

    # if there is an --infile, open graph in editor
    if ARGS is not None and ARGS.infile is True:
        graph.view_edit()

    # Main Loop
    while True:
        if SHELL.interface in ['bash']:
            Cli.clear()

        # Will this work on SL4A?
        main_response = Cli.make_page(
            'MENU: Main', graph, lambda: SHELL.list_menu(MAIN_OPTS))
        print(main_response)

        #use try keyboard interrupt
        if main_response == 1:
            graph = graph_operations(graph)
        elif main_response == 2:
            graph = functions_menu(graph)
        elif main_response == 3:
            graph.access_gnugo_functs(BASENAME)
        elif main_response == 4:
            graph = file_actions(graph)
        else:
            break
开发者ID:hammerhorn,项目名称:hammerhorn-jive,代码行数:40,代码来源:gocalc.py


注:本文中的cjh.cli.Cli.clear方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。