import time import json from web_asker import WebAsker web_asker = None with open("mongo_adress_list.json") as adress_file: adress_list = json.load(adress_file) for adress in adress_list: try: web_asker = WebAsker(adress) except Exception, e: print "Cannot reach {}.".format(adress) print "Trying next adress..." else: break if web_asker is None: print "Cannot reach any adress." else: web_asker.clear_all() t = 0 last_t = 0 window = 1 period = 0.05 pause_question = web_asker.ask("Pause ?", ["Pause !"], priority=10) feedback_question = web_asker.ask("Rate behavior : ", [])
import time import json from web_asker import WebAsker web_asker = None with open("mongo_adress_list.json") as adress_file: adress_list = json.load(adress_file) for adress in adress_list: try: web_asker = WebAsker(adress) except Exception, e: print "Cannot reach {}.".format(adress) print "Trying next adress..." else: break if web_asker is None: print "Cannot reach any adress." else: web_asker.clear_all() while True: question = web_asker.ask("Pick an action :", ["Wait", "Hold", "Pick", "Give", "Go_home"]) action = question.get_answer().lower() if action == "wait": action_tuple = action