def load_wemo(): global switch, ip try: file2 = open(r"d.pkl", "rb") new_d = pickle.load(file2) file2.close() ip = new_d["ip"] except IOError: ip_popup() switch = wemo(ip)
def load_wemo(): global switch, ip try: file2 = open(r'd.pkl', 'rb') new_d = pickle.load(file2) file2.close() ip = new_d["ip"] except IOError: ip_popup() switch = wemo(ip)
def click_down(event): global ip, switch event.widget.config(bg="#B71C1C") if event.widget.name == "clear": clear() elif event.widget.name == "enter": start_timer_add() elif event.widget.name == "ip": ip_popup() elif event.widget.name == "save": d = {"ip": msg.get()} afile = open(r"d.pkl", "wb") pickle.dump(d, afile) afile.close() ip = msg.get() switch = wemo(ip) top.destroy() elif len(display) < 4: display.append(event.widget.cget("text")) update_display()
def click_down(event): global ip, switch event.widget.config(bg="#B71C1C") if event.widget.name == "clear": clear() elif event.widget.name == "enter": start_timer_add() elif event.widget.name == "ip": ip_popup() elif event.widget.name == "save": d = {"ip": msg.get()} afile = open(r'd.pkl', 'wb') pickle.dump(d, afile) afile.close() ip = msg.get() switch = wemo(ip) top.destroy() elif len(display) < 4: display.append(event.widget.cget("text")) update_display()