def new_query(x, y): global Query_list global Conditional_list global flags xshift = 200 if x >= 315 and x <= 495 and y >= -240 and y <= -215: draw_box(Turtle(), "white", "", 315, -220, 180, "white") draw_box(Turtle(), "white", "", 410, -250, 120, "white") refresh(Query_list + Conditional_list) draw_box( Turtle(), "lightgreen", "Generated Query is ", -300 - xshift, -220, 760) draw_box( Turtle(), "lightgreen", "Answer = ", -300 - xshift, -250, 760) clear_mar_cond() clear_mar_quer() for i in flags: flags[i] = 0 del Query_list[:] del Conditional_list[:] screen = turtle.Screen() screen.onclick(take_input) return if x >= 410 and x <= 530 and y >= -270 and y <= -245: turtle.bye()
import cv2 import gui import argparse parser = argparse.ArgumentParser(description='Threshold some images') parser.add_argument('image', type=str, help='Path to an image') args = parser.parse_args() image = cv2.imread(args.image) while True: gui.display(image) try: gui.refresh() except KeyboardInterrupt: break gui.close()
def guiloop(): global question while True: gui.refresh(pet, pet["currentemo"], question)
if os.path.exists(info_path) and os.path.isfile(info_path): try: xroot = ElementTree.parse(info_path).getroot() for key in ('fullname', *config.info_defaults.keys()): tag = xroot.find(key) if tag is not None: info[key] = tag.text for sub in tag: if sub.tag in config.allowed_html_tags: info[key] += str(ElementTree.tostring(sub)) else: info[key] += '' or sub.tail except: print(_('Error cargando "{path}"').format(path=info_path)) return info game_infos = [] dirs = [item for item in os.listdir(mconf.games_folder) if os.path.isdir(os.path.join(mconf.games_folder, item))] for game_name in sorted(dirs): print("Game found:"+game_name) game_infos.append(load_game_info(game_name)) import gui gui.game_infos = game_infos gui.refresh() pyglet.app.run()