Пример #1
0
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)
Пример #2
0
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)
Пример #3
0
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()
Пример #4
0
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()