Example #1
0
    def select_routineDeactTime_frame(self):
        self.clearFrame()

        self.select_routineDeactTimeFrame = tk.Frame()
        self.select_routineDeactTimeFrame.pack()

        #Key press functions for select_routineTimeFrame:
        def enter_pressed(event):
            if ((len(time.get()) == 5) and (time.get()[2] == ':')
                    and (time.get()[0:1].isnumeric())
                    and (time.get()[3:4].isnumeric())):
                self.selectedRoutineDeactTime = [time.get()]

                self.TempWakeUpRoutines.append(self.selectedRoutineActTime[0])
                self.TempWakeUpRoutines.append(self.selectedRoutineUnit)
                self.TempWakeUpRoutines.append(
                    self.selectedRoutineDeactTime[0])

                self.select_routineroom_frame()
            else:
                return

        def textbox_clicked(event):
            time.set("")
            return

        #Layout for enter_unit_adressFrame:
        time = tk.StringVar()
        time.set("HH:MM")
        self.enter_time = tk.Entry(self.select_routineDeactTimeFrame,
                                   textvariable=time)
        self.enter_time.pack(side=tk.TOP, fill=tk.X)
        self.enter_time.bind("<Button-1>", textbox_clicked)

        root.bind('<Return>', enter_pressed)
Example #2
0
def timer():  #Updates and tracks time for the timer
    x = 0.00
    if x >= 0.00:
        new_time = time.get() + 1
        time.set(new_time)
        can.after(1000, timer)  #call this function again in 1,000 milliseconds
        x += 1
Example #3
0
 def add_setting(self):
     path,filename = os.path.split(self.new_setting_dialog())
     name = tk.StringVar()
     name.set(filename)
     time = tk.IntVar()
     time.set(self.settings["default"]["timer"].get())
     self.settings[filename] = {"name":name,"timer":time}
     self._draw_settings_screen()
Example #4
0
def onselect(evt):
    # Note here that Tkinter passes an event object to onselect()
    global index
    w = evt.widget
    if len(w.curselection()) == 0:
        listbox.select_set(index)
        return
    index = int(w.curselection()[0])
    value = w.get(index)
    time.set(value[0:5].strip())
    message.set(value[5:].strip())
    print('You selected item %d: "%s"' % (index, value))
Example #5
0
def updategui():
    updatesg()
    updatetherm()
    #temperaturecontrol() TURN ON ONCE TEMP CONTROL TESTING IS NECESSARY
    ftemp = open('/home/pi/Desktop/Interface/temp.txt', 'a')
    fsg = open('/home/pi/Desktop/Interface/sg.txt', 'a')

    tempread = str(read_temp())
    sgread = str(read_Sg())  #  TURN ON ONCE HYDROMETER IS FUNCTIONAL
    #sgread = "1.6"
    timeread = str(read_time())
    temperature.set("Current Temperature " + tempread + "°C")
    writetemp = '\n' + timeread + " " + tempread
    ftemp.write(writetemp)
    sg.set("Current Specific Gravity: " + sgread)
    writesg = '\n' + timeread + " " + sgread
    fsg.write(writesg)
    time.set("Current Time: " + timeread)
    root.update()
    root.after(60000, updategui)
    print(read_temp())
    print(read_Sg())
    datetime = timeread.split()
    date = datetime[0]
    print(date)
    timer = datetime[1]
    print(timer)
    tk.Label(root,
             text=str(read_temp()) + "°C",
             font=("NotoSans-Bold", 45),
             fg='#ff8d00',
             background='white').grid(row=10, column=1)
    tk.Label(root,
             text=str(read_Sg()),
             font=("NotoSans-Bold", 45),
             fg='#ff8d00',
             background='white').grid(row=10, column=4)
    tk.Label(titleframe,
             text=str(read_timegui() + "          "),
             font=("NotoSans-Bold", 14),
             fg='white',
             background='#ff8d00',
             compound="center").grid(row=0, column=6)
Example #6
0
def ref():
    a = str(sharename.get())
    sharename.set(a)
    print a
    b = code(a)
    print b
    c = str(time.get())
    time.set(c)
    print c
    l = linereg(a, c)
    lr.set(l[0])
    lrerr.set(l[1])
    cp.set(b)

    svm_1 = svmalgo(a, c)
    svm.set(svm_1[0])
    svmerr.set(svm_1[1])

    status = nws(a)
    na.set(status)
# -*- coding: utf-8 -*-
"""
Created on Mon Jul 27 14:33:28 2020

@author: user
"""


mc=Min
from mcpi.minecraft import Minecraftecraft.create()
import time

x,y,z = mc.player.getTilePos()

y = y + 100
mc.player.setTilePos(x,y,z)
time.set(10)

y = y + 100
mc.player.setTilePos(x,y,z)
time.set(10) 

y = y + 100
mc.player.setTilePos(x,y,z)
                                    
Example #8
0
 def textbox_clicked(event):
     time.set("")
     return
Example #9
0
print("Start")
port = "COM3"  #uses COM3 to connect with arduino
bluetooth = serial.Serial(port, 9600)  #Connects over 9600
print("Connected")
bluetooth.reset_input_buffer()  #clears what's being sent over bluetooth

can = tk.Tk()  #Creates timer canvas

can.title("Timer")  #Names canvas

frame = tk.Frame(can, width=200, height=90)  #creates frame for timer
frame.pack()

time = tk.DoubleVar()  #creates time var
time.set(0)  #sets time to zero

t_font = font.Font(family='Arial', size=30)

ticker = tk.Label(can, font=t_font, bg="white", textvariable=time)
ticker.place(x=100, y=20, anchor=tk.CENTER)

#start button that starts timer
start = tk.Button(can,
                  width=6,
                  height=2,
                  text="Start",
                  bg="white",
                  command=start)
start.place(x=100, y=70, anchor=tk.CENTER)
Example #10
0
def update(time):
    s = paratime.seconds()
    t = paratime.text(s)
    p = 1000000000 * 1.01 ** (s / paratime.SECOND_IN_YEAR)
    time.set('Time = {0}\nNational = {1}'.format(t, fix(p)))
Example #11
0
def update(time):
    s = paratime.seconds()
    t = paratime.text(s)
    p = 1000000000 * 1.01**(s / paratime.SECOND_IN_YEAR)
    time.set('Time = {0}\nNational = {1}'.format(t, fix(p)))
    def preGame(self):
        newWindow = Tk()
        newWindow.geometry("600x200+425+250")
        newWindow.resizable(width=FALSE, height=FALSE)
        
        instructLabel = Label(newWindow, text="When you are ready to play, input your name and press play.")
        instructLabel.place(x=135, y=15)

        e = Entry(newWindow)
        e.place(x=225, y=50)
        
        playButton = Button(newWindow, text="Play", command = lambda: self.loadGameArena(newWindow, e))
        playButton.place(x=355, y=46)


        conn = sqlite3.connect('gameDatabase.db')
        c = conn.cursor()

        name = StringVar(newWindow)
        pixels = StringVar(newWindow)
        time = StringVar(newWindow)
        date = StringVar(newWindow)
        
        c.execute("SELECT name from gameStats WHERE id=1")
        for row in c:
            name.set(row)

        c.execute("SELECT pixels from gameStats WHERE id=1")
        for row in c:
            pixels.set(row)

        c.execute("SELECT time from gameStats WHERE id=1")
        for row in c:
            time.set(row)

        c.execute("SELECT date from gameStats WHERE id=1")
        for row in c:
            date.set(row)
        
        conn.commit()
        conn.close()

        lastTime = Label(newWindow, text="LAST TIME YOU PLAYED:")
        lastTime.place(x=230, y = 100)
        nameLabel = Label(newWindow, text="Name:")
        nameLabel.place(x=100, y=125)
        theName = Label(newWindow, textvariable = name)
        theName.place(x=100, y=140)

        pixelsLabel = Label(newWindow, text="Pixels travelled:")
        pixelsLabel.place(x=175, y=125)
        thePixels = Label(newWindow, textvariable = pixels)
        thePixels.place(x=175, y=140)

        timeLabel = Label(newWindow, text="Time elapsed (secs):")
        timeLabel.place(x=300, y=125)
        theTime = Label(newWindow, textvariable = time)
        theTime.place(x=300, y = 140)

        dateLabel = Label(newWindow, text="Date last played:")
        dateLabel.place(x=450, y=125)
        theDate = Label(newWindow, textvariable = date)
        theDate.place(x=450, y = 140)
        
        
        newWindow.mainloop()