本文整理匯總了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'
示例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)
示例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
示例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