Example #1
0
def main():
    root = Tk()
    root.title(getIndianDetails()[0])
    root.iconbitmap("icon.ico")
    canvas = Canvas(root, height=717, width=992)
    time = Label(root,
                 text="Last\nRefreshed on :\n" + str(getTime()),
                 fg="black",
                 font="Verdana 15 ")
    time.place(x=815, y=500)
    button = Button(root,
                    text="Refresh",
                    justify='right',
                    bg='#38dcf5',
                    font="Verdana 15 bold",
                    command=lambda: refresh(root, time))
    button.place(x=845, y=640, height=40, width=100)
    createTable(canvas)
    makeHeader(root)
    makeStates(root)
    canvas.pack()
    th = threading.Thread(target=notify_me)
    th.setDaemon(TRUE)
    th.start()
    root.mainloop()
Example #2
0
def set_time():    ##Function to  set alarm time 
    global flag,hou,mins
    flag=1
    time=Label( root,text="Alarm Time",font= ("roboto bold", 45 ,"normal"))
    time.place( x=750,y=350)
    hrs = Label( root,text="Hours:",font= ("roboto bold", 15 ,"normal"))
    hrs.place( x=810,y=420)
    mn = Label( root,text="Min:",font= ("roboto bold", 15 ,"normal"))
    mn.place( x=900,y=420)
    hou=var.get()
    mins=var2.get()
    atl = Label(root,text=hou,font= ("roboto bold", 15 ,"normal"))
    atl.place( x=870,y=420)
    at2 = Label(root,text=mins,font= ("roboto bold", 15 ,"normal"))
    at2.place( x=940,y=420)
Example #3
0
def ch_skew():

    awggui = tk.Tk()
    awggui.title('awg-async')
    awggui.geometry('500x300')
    labellist = ['ch1', 'ch2', 'ch3', 'ch4']
    # await cw.genwaveform(awg,labellist,[1,2,3,4],t_list=t_lst)

    ch_time = []
    for j, i in enumerate(labellist):
        label = tk.Label(awggui,
                         text=i,
                         bg='green',
                         font=('Arial', 12),
                         width=10,
                         height=2)
        label.place(x=3, y=75 * j)
        timevar = tk.StringVar(awggui, str(defaulttime[j]).strip('"]","["'))
        time = tk.Entry(awggui, textvariable=timevar, font=('Arial', 12))
        time.place(x=120, y=75 * j + 10)
        ch_time.append(timevar)

    def hit_me():
        # global ch_time
        wav = []
        tlst = []
        for i in ch_time:
            t = eval(i.get())
            tlst.append(t)
            pulse = wn.square(5000 / 1e9) << (2500 + t) / 1e9
            wav.append(pulse(t_lst))

        for i, j in enumerate(['ch1', 'ch2', 'ch3', 'ch4']):
            update_marker(awg, j, wav[i])
        if isinstance(tlst[0], int):
            with open(r'D:\QuLabData\awgGui\state.txt', mode='w') as filename:
                filename.write(str(tlst))
                filename.write('\n')
        print('Done!')

    tk.Button(awggui,
              text='Enter',
              font=('Arial', 12),
              width=15,
              height=3,
              command=hit_me).place(x=340, y=110)
    awggui.mainloop()
Example #4
0
  def __init__(self, master=None, cnf={}, **kw):
    super().__init__(master=master, cnf=cnf, **kw)
    bg = self.cget('bg')
    self.widgets = []
    self.labels = [[] for _ in range(self.N_ROWS)]
    self.frames = [[] for _ in range(self.N_ROWS)]
    for r in range(self.N_ROWS):

      pos_frame = tkinter.Frame(self, bg=bg)
      self.frames[r].append(pos_frame)
      pos_frame.grid(row=r, column=0, sticky='news')
      pos =  tkinter.Label(pos_frame, bg=bg)
      self.labels[r].append(pos)
      pos.place(relx=0.5, rely=0.5, anchor='c')

      name_frame = tkinter.Frame(self, bg=bg)
      self.frames[r].append(name_frame)
      name_frame.grid(row=r, column=1, sticky='news')
      name = tkinter.Label(name_frame, bg=bg)
      self.labels[r].append(name)
      name.place(x=0, rely=0.5, anchor='w')

      club_frame = tkinter.Frame(self, bg=bg)
      self.frames[r].append(club_frame)
      club_frame.grid(row=r, column=2, sticky='news')
      club = tkinter.Label(club_frame, bg=bg, width=5,
                           anchor='w')
      self.labels[r].append(club)
      club.place(x=0, rely=0.5, anchor='w')

      time_frame = tkinter.Frame(self, bg=bg)
      self.frames[r].append(time_frame)
      time_frame.grid(row=r, column=3, sticky='news')
      time = tkinter.Label(time_frame, bg=bg, width=7,
                           anchor='e')
      self.labels[r].append(time)
      time.place(relx=1, rely=0.5, anchor='e')

      self.widgets.append([pos_frame, pos, name_frame, name,
                           club_frame, club, time_frame, time])

    [self.rowconfigure(r, weight=1) for r in range(self.N_ROWS)]
    self.columnconfigure(1, weight=1)
    self.set_default_style(initial=True)
    self.set_column_widths()
Example #5
0
def moreScreen():
    global speed

    # Create window for more menu
    other = Toplevel()
    other.title("Pepp Other Screen")
    other.geometry('800x480')
    other.configure(bg=main_bg)
    other.overrideredirect(1)

    # Fonts for screen
    stopFont = font.Font(family='Helvetica', size=50, weight='bold')
    otherFont = font.Font(family='Helvetica', size=24, weight='normal')
    headingFont = font.Font(family='Helvetica', size=20, weight='normal')
    calibFont = font.Font(family='Helvetica', size=30, weight='normal')
    diagFont = font.Font(family='Helvetica', size=19, weight='normal')

    # Other screen buttons
    helpButton = Button(other,
                        text="HELP",
                        font=stopFont,
                        bg="red2",
                        fg="#FFFFFF",
                        command=sos,
                        height=1,
                        width=8)
    helpButton.place(x=460, y=20)
    home = Button(other,
                  text="HOME",
                  font=otherFont,
                  bg=button_color,
                  fg=main_fg,
                  command=other.destroy,
                  height=2,
                  width=10)
    home.place(x=575, y=380)

    #TEMPORARY QUIT
    quitButton = Button(other,
                        text="QUIT",
                        font=diagFont,
                        bg=button_color,
                        fg=main_fg,
                        command=screen.destroy,
                        height=2,
                        width=4)
    quitButton.place(x=300, y=10)

    # Machine diagnostics
    diag = Text(other,
                font=headingFont,
                bd=-2,
                bg=main_bg,
                fg=main_fg,
                height=1,
                width=21)
    diag.insert(INSERT, "MACHINE DIAGNOSTICS")
    diag.place(x=460, y=125)

    # Read data from file
    with open('SmartPepp/diagnostics.txt', 'r') as reader:
        diags = reader.read().splitlines()

    hours = Text(other,
                 font=diagFont,
                 bd=-2,
                 bg=main_bg,
                 fg=main_fg,
                 height=1,
                 width=37)
    hours.insert(
        INSERT, "Total Machine Hours.........." + str(int(int(diags[1]) / 60)))
    hours.place(x=460, y=170)
    pepped = Text(other,
                  font=diagFont,
                  bd=-2,
                  bg=main_bg,
                  fg=main_fg,
                  height=1,
                  width=37)
    pepped.insert(INSERT, "Total Pizzas Pepped.........." + diags[2])
    pepped.place(x=460, y=220)
    time = Text(other,
                font=diagFont,
                bd=-2,
                bg=main_bg,
                fg=main_fg,
                height=1,
                width=37)
    time.insert(INSERT, "Average Pizza Time..........." + diags[3])
    time.place(x=460, y=270)
    health = Text(other,
                  font=diagFont,
                  bd=-2,
                  bg=main_bg,
                  fg=main_fg,
                  height=1,
                  width=37)
    health.insert(INSERT, "Machine Health..........." + diags[4])
    health.place(x=460, y=320)

    # Calibration
    calib = Text(other,
                 font=headingFont,
                 bd=-2,
                 bg=main_bg,
                 fg=main_fg,
                 height=1,
                 width=27)
    calib.insert(INSERT, "PEPP WEIGHT CALIBRATION")
    calib.place(x=10, y=10)

    text14 = Text(other,
                  font=calibFont,
                  bd=-2,
                  bg=main_bg,
                  fg=main_fg,
                  height=1,
                  width=3)
    text14.insert(INSERT, "14\"")
    text14.place(x=10, y=80)
    text12 = Text(other,
                  font=calibFont,
                  bd=-2,
                  bg=main_bg,
                  fg=main_fg,
                  height=1,
                  width=3)
    text12.insert(INSERT, "12\"")
    text12.place(x=10, y=170)
    text10 = Text(other,
                  font=calibFont,
                  bd=-2,
                  bg=main_bg,
                  fg=main_fg,
                  height=1,
                  width=3)
    text10.insert(INSERT, "10\"")
    text10.place(x=10, y=260)
    text7 = Text(other,
                 font=calibFont,
                 bd=-2,
                 bg=main_bg,
                 fg=main_fg,
                 height=1,
                 width=3)
    text7.insert(INSERT, "7\"")
    text7.place(x=10, y=350)

    speed14Var = DoubleVar()
    speed14Var.set(calibration[14])
    speed14 = Label(other,
                    font=calibFont,
                    textvariable=speed14Var,
                    bg=button_color,
                    fg=main_fg,
                    bd=-2,
                    height=1,
                    width=7)
    speed14.place(x=160, y=82)
    speed12Var = DoubleVar()
    speed12Var.set(calibration[12])
    speed12 = Label(other,
                    font=calibFont,
                    textvariable=speed12Var,
                    bg=button_color,
                    fg=main_fg,
                    bd=-2,
                    height=1,
                    width=7)
    speed12.place(x=160, y=172)
    speed10Var = DoubleVar()
    speed10Var.set(calibration[10])
    speed10 = Label(other,
                    font=calibFont,
                    textvariable=speed10Var,
                    bg=button_color,
                    fg=main_fg,
                    bd=-2,
                    height=1,
                    width=7)
    speed10.place(x=160, y=262)
    speed7Var = DoubleVar()
    speed7Var.set(calibration[7])
    speed7 = Label(other,
                   font=calibFont,
                   textvariable=speed7Var,
                   bg=button_color,
                   fg=main_fg,
                   bd=-2,
                   height=1,
                   width=7)
    speed7.place(x=160, y=352)

    sub14 = Button(other,
                   text="-",
                   font=calibFont,
                   bg=button_color,
                   fg=main_fg,
                   command=lambda: subtract(14, speed14Var),
                   height=1,
                   width=2)
    sub14.place(x=80, y=75)
    add14 = Button(other,
                   text="+",
                   font=calibFont,
                   bg=button_color,
                   fg=main_fg,
                   command=lambda: add(14, speed14Var),
                   height=1,
                   width=2)
    add14.place(x=325, y=75)
    sub12 = Button(other,
                   text="-",
                   font=calibFont,
                   bg=button_color,
                   fg=main_fg,
                   command=lambda: subtract(12, speed12Var),
                   height=1,
                   width=2)
    sub12.place(x=80, y=165)
    add12 = Button(other,
                   text="+",
                   font=calibFont,
                   bg=button_color,
                   fg=main_fg,
                   command=lambda: add(12, speed12Var),
                   height=1,
                   width=2)
    add12.place(x=325, y=165)
    sub10 = Button(other,
                   text="-",
                   font=calibFont,
                   bg=button_color,
                   fg=main_fg,
                   command=lambda: subtract(10, speed10Var),
                   height=1,
                   width=2)
    sub10.place(x=80, y=255)
    add10 = Button(other,
                   text="+",
                   font=calibFont,
                   bg=button_color,
                   fg=main_fg,
                   command=lambda: add(10, speed10Var),
                   height=1,
                   width=2)
    add10.place(x=325, y=255)
    sub7 = Button(other,
                  text="-",
                  font=calibFont,
                  bg=button_color,
                  fg=main_fg,
                  command=lambda: subtract(7, speed7Var),
                  height=1,
                  width=2)
    sub7.place(x=80, y=345)
    add7 = Button(other,
                  text="+",
                  font=calibFont,
                  bg=button_color,
                  fg=main_fg,
                  command=lambda: add(7, speed7Var),
                  height=1,
                  width=2)
    add7.place(x=325, y=345)
Example #6
0
    day = checkDay(read)
    print(
        str(datetime.now().strftime("%A, %B %d, %Y")) + " | Letter Day: " +
        day)
    letter_label = Label(root, font="Arial 20 bold", text="Letter Day:")
    letter_label.place(x=185, y=200)
    day_label = Label(root, font="Arial 50 bold", text=day)
    day_label.place(x=225, y=250)
    prev_button = Button(root,
                         text="previous",
                         command=lambda: changeDay(False))
    prev_button.place(x=10, y=450)
    add_button = Button(root, text="next", command=lambda: changeDay(True))
    add_button.place(x=70, y=450)
    time = Label(root,
                 font="Arial 20 bold",
                 text=datetime.now().strftime("%H:%M:%S"))
    time.place(x=380, y=450)
    weekday_label = Label(root,
                          font="Arial 15 bold",
                          text=datetime.now().strftime("%A"))
    weekday_label.place(x=380, y=420)
    update_time()
else:
    print("Restarting day of the week...")
    time.sleep(2)
    print("Please restart program to use.")
    time.sleep(5)

root.mainloop()
Example #7
0
                         activebackground='#c5c5c5',
                         command=lambda: show_audio())
button_audio.place(relx=0.257, rely=0.5, relwidth=0.25, relheight=0.45)

rectangle_image = tk.PhotoImage(
    file=r"/home/pi/Smart Home dashboard/gui figures/rectangle_background_2.png"
)
rectangle_label = tk.Label(canvas,
                           image=rectangle_image,
                           borderwidth=0,
                           bg='#d3d2d2',
                           activebackground='#d3d2d2')
rectangle_label.place(relx=0.5, rely=0, relwidth=0.48, relheight=1)

time = tk.Label(canvas, font=("Helvetica 24 bold"), fg='white', bg='#3f66b0')
time.place(relx=0.67, rely=0.16, relwidth=0.15, relheight=0.08)

date = tk.Label(canvas, font=("Helvetica 22 bold"), fg='white', bg='#3f66b0')
date.place(relx=0.55, rely=0.24, relwidth=0.38, relheight=0.08)

calendar_image = tk.PhotoImage(
    file=r"/home/pi/Smart Home dashboard/gui figures/calendar.png")
calendar_label = tk.Label(canvas,
                          image=calendar_image,
                          borderwidth=0,
                          bg='#d3d2d2',
                          activebackground='#d3d2d2')
calendar_label.place(relx=0.5, rely=0.48, relwidth=0.48, relheight=0.45)

#################################################################
Example #8
0
    def mini_statement(self):
        details = list(self.cur.execute('SELECT trans,amount,balance,datetime FROM Trans WHERE account_id=? ORDER BY id DESC LIMIT ?',(self.account_id,5)))
        data=[]
        data.append(["Date","Time","Transaction","Amount","Balance"])
        for i in range(len(details),0,-1):
            trans,amount,balance,datetime = details[i-1]
            data.append([str(datetime).split(' ')[0],str(datetime).split(' ')[1],trans,str(amount),str(balance)])
        self.edit_balance("mini statement",data)
        self.top4.destroy()

        top = Toplevel()
        top.geometry('550x700')
        top.title('HADS BANK')

        label = Label(top,text= 'HADS BANK',font=('Times',25,'bold'))
        label.place(x=170,y=30)

        label1 = Label(top,text= 'Sector 3,Near XYZ,Pincode - 410206',font=('Times',20,'bold'))
        label1.place(x=80,y=80)

        label2 = Label(top,text= '_________________________',font=('Times',25,'bold'))
        label2.place(x=70,y=110)

        Type = Label(top,text = 'TYPE',font=('Times',15,'bold')) 
        Type.place(x=50,y=180)

        date = Label(top,text = 'DATE',font=('Times',15,'bold')) 
        date.place(x=150,y=180)

        time = Label(top,text = 'TIME',font=('Times',15,'bold')) 
        time.place(x=280,y=180)

        Amount = Label(top,text = 'AMOUNT',font=('Times',15,'bold')) 
        Amount.place(x=420,y=180)
        
        text_list = []
        for i in range(len(details),0,-1):
            trans,amount,balance,datetime = details[i-1]
            text = trans+'\t'+str(datetime).split(' ')[0]+'\t'+str(datetime).split(' ')[1]+'\t\t'+str(amount)
            text_list.append(text)
            
        entry1 = Label(top,text =text_list[0],font=('Times',15,'bold')) 
        entry1.place(x=50,y=230)

        entry2 = Label(top,text = text_list[1],font=('Times',15,'bold')) 
        entry2.place(x=50,y=280)

        entry3 = Label(top,text = text_list[2],font=('Times',15,'bold')) 
        entry3.place(x=50,y=330)

        entry4 = Label(top,text = text_list[3],font=('Times',15,'bold')) 
        entry4.place(x=50,y=380)

        entry5 = Label(top,text = text_list[4],font=('Times',15,'bold')) 
        entry5.place(x=50,y=430)

        label3 = Label(top,text= '_________________________',font=('Times',25,'bold'))
        label3.place(x=70,y=450)

        balance= Label(top,text = 'BALANCE :',font=('Times',15,'bold')) 
        balance.place(x=280,y=500)

        balance1= Label(top,text = str(self.balance),font=('Times',15,'bold')) 
        balance1.place(x=450,y=500)
        top.after(10000,top.destroy)
start_button.pack()

# Entrer un nombre
enter_proposition = tk.Entry(frame, font=("Courrier", 30))
enter_proposition.bind('<Return>', essai)

# Ajouter un bouton de validation
button = tk.Button(frame, text="Check", font=("Courrier", 25), command=essai)

# Ajouter un texte
infovar = tk.StringVar()
infovar.set("Good luck !")
info = tk.Label(frame, textvariable=infovar, font=("Courrier", 30), bg='#202020', fg='white')

# Ajouter une variable qui stock le nombre de tentatives
attempsvar = tk.StringVar()
attempsvar.set("9 attemps left")

# Afficher le nombre de tentatives
number_attempts = tk.Label(root, textvariable=attempsvar, bg='#202020', fg='white', font=("Courrier", 20))

# Afficher le temps restant
time = tk.Label(root, text="", font=("Courrier", 20), fg='white', bg='#202020')
time.place(x=20, y=20)

# Ajouter un bouton close
close = tk.Button(frame, text="Close", font=("Courrier", 25), command=root.destroy)

# Afficher la fenetre
root.mainloop()
Example #10
0
def seceond_window():
    hide
    root = Tk()
    root.title("Hospital Appointment")

    title = Label(root,
                  text="XYZ Hospital Appointment",
                  font=('times new roman', 35, 'bold'),
                  fg="steelblue")
    title.place(x=20, y=10)

    # patient name
    patient = Label(root,
                    text="Patient Name  ",
                    font=('times new roman', 16, 'bold'),
                    fg="steelblue")
    patient.place(x=20, y=100)

    patient_ent = Entry(root, font=('times new roman', 11, ''), width=35)
    patient_ent.place(x=220, y=100)

    gen = Label(root,
                text="Gender",
                font=('times new roman', 16, 'bold'),
                fg="steelblue")
    gen.place(x=20, y=140)

    gen_ent = Entry(root, font=('times new roman', 11, ''), width=35)
    gen_ent.place(x=220, y=140)

    Age = Label(root,
                text="Age",
                font=('times new roman', 16, 'bold'),
                fg="steelblue")
    Age.place(x=20, y=180)

    Age_ent = Entry(root, font=('times new roman', 11, ''), width=35)
    Age_ent.place(x=220, y=180)

    loc = Label(root,
                text="Address",
                font=('times new roman', 16, 'bold'),
                fg="steelblue")
    loc.place(x=20, y=220)

    Loc_ent = Entry(root, font=('times new roman', 11, ''), width=35)
    Loc_ent.place(x=220, y=220)

    time = Label(root,
                 text="Appointment Time",
                 font=('times new roman', 16, 'bold'),
                 fg="steelblue")
    time.place(x=20, y=260)

    time_ent = Entry(root, font=('times new roman', 11, ''), width=35)
    time_ent.place(x=220, y=260)

    sql2 = "SELECT Name  FROM Appointment "

    sql2exec = curs.execute(sql2)

    for i in sql2exec:
        name = i[0]
        lists.append(name)

    final_name = len(lists)

    box = Text(root,
               width=35,
               height=15,
               font=('times new roman', 13, 'italic'),
               fg="black")
    box.place(x=520, y=100)

    box.insert(END, "Total  Appointment till now is : " + str(final_name))
    log = Label(root,
                text="Logs",
                font=('times new roman', 17, 'bold'),
                fg="steelblue")
    log.place(x=532, y=65)

    def add_appoinment():
        val1 = patient_ent.get()
        val2 = gen_ent.get()
        val3 = Age_ent.get()
        val4 = Loc_ent.get()
        val5 = time_ent.get()

        if val1 == "" or val2 == "" or val3 == "" or val4 == "" or val5 == "":
            tkinter.messagebox.showinfo("Warning", "Please enter all details")

        else:
            sql = "INSERT INTO 'Appointment'(Name, Gender, Age, Address, Appoint_time) VALUES(?, ?, ?, ?, ?)"
            curs.execute(sql, (val1, val2, val3, val4, val5))
            conn.commit()
            tkinter.messagebox.showinfo(
                "Congrats", "You succesfully booked you appointent")
            box.insert(END, "\n")
            box.insert(
                END,
                str(val1) + " your appointment has been fixed at " + str(val5))

    btn = Button(root,
                 font=('arial', 9, 'bold'),
                 text="Add appoinment",
                 width=14,
                 fg='white',
                 height=1,
                 bg="steelblue",
                 command=add_appoinment)
    btn.place(x=300, y=300)

    def hide2():
        root.destroy()

    def modify():

        hide2()
        root = Tk()
        root.title("Update Appointment")

        title = Label(root,
                      text="Update Appointmenets",
                      font=('times new roman', 35, 'bold'),
                      fg="steelblue")
        title.place(x=75, y=10)

        patient = Label(root,
                        text="Patient Name  ",
                        font=('times new roman', 16, 'bold'),
                        fg="steelblue")
        patient.place(x=105, y=100)

        patient_ent = Entry(root, font=('airal', 12, ''), width=30)
        patient_ent.place(x=280, y=100)

        def update_appointment():
            x = patient_ent.get()

            if x == "":
                tkinter.messagebox.showinfo("Warning ",
                                            "Kindly Enter patient Name")

            else:
                sql = "SELECT * FROM Appointment WHERE Name LIKE ?"

                res = curs.execute(sql, (x, ))

                for i in res:
                    name = i[0]
                    gender = i[1]
                    Age = i[2]
                    Address = i[3]
                    Appoint_time = i[4]

                # print("your age is "+ str(Age))

                details = Label(root,
                                text="your current detaisl are .....",
                                font=('times new roman', 12),
                                fg="grey")
                details.place(x=105, y=164)

                Name = Label(root,
                             text="Name  ",
                             font=('times new roman', 16, 'bold'),
                             fg="steelblue")
                Name.place(x=105, y=190)

                Name_ent = Entry(root, font=('airal', 12, ''), width=30)
                Name_ent.place(x=300, y=185)
                Name_ent.insert(END, name)

                gen = Label(root,
                            text="Gender",
                            font=('times new roman', 16, 'bold'),
                            fg="steelblue")
                gen.place(x=105, y=225)

                gen_ent = Entry(root, font=('arial', 12, ''), width=30)
                gen_ent.place(x=300, y=225)
                gen_ent.insert(END, gender)

                Ages = Label(root,
                             text="Age",
                             font=('times new roman', 16, 'bold'),
                             fg="steelblue")
                Ages.place(x=105, y=268)

                Age_ent = Entry(root, font=('arial', 12, ''), width=30)
                Age_ent.place(x=300, y=268)
                Age_ent.insert(END, Age)

                loc = Label(root,
                            text="Address",
                            font=('times new roman', 16, 'bold'),
                            fg="steelblue")
                loc.place(x=105, y=315)

                Loc_ent = Entry(root, font=('arial', 12, ''), width=30)
                Loc_ent.place(x=300, y=315)
                Loc_ent.insert(END, Address)

                time = Label(root,
                             text="Appointment Time",
                             font=('times new roman', 16, 'bold'),
                             fg="steelblue")
                time.place(x=105, y=357)

                time_ent = Entry(root, font=('freesans', 12, ''), width=30)
                time_ent.place(x=300, y=357)
                time_ent.insert(END, Appoint_time)

            def update():
                val1 = Name_ent.get()
                val2 = gen_ent.get()
                val3 = Age_ent.get()
                val4 = Loc_ent.get()
                val5 = time_ent.get()

                query = "UPDATE  Appointment SET Name=?, Gender=?, Age=?, Address=?, Appoint_time=?  WHERE Name Like?"
                curs.execute(query,
                             (val1, val2, val3, val4, val5, patient_ent.get()))
                conn.commit()

                tkinter.messagebox.showinfo("Update", "Updated Succesfully")

            def delete():

                query2 = "DELETE FROM  Appointment  WHERE Name Like?"
                curs.execute(query2, (patient_ent.get(), ))
                conn.commit()

                tkinter.messagebox.showinfo("Delete", "Deleted Succesfully")

                Name_ent.destroy()
                gen_ent.destroy()
                Age_ent.destroy()
                Loc_ent.destroy()
                time_ent.destroy()

            updbtn = Button(root,
                            font=('times new roman', 10, 'bold'),
                            text="Update",
                            width=11,
                            height=1,
                            fg='white',
                            bg="steelblue",
                            command=update)
            updbtn.place(x=300, y=410)

            delbtn = Button(root,
                            font=('times new roman', 10, 'bold'),
                            text="Delete",
                            width=11,
                            height=1,
                            fg='white',
                            bg="red",
                            command=delete)
            delbtn.place(x=420, y=410)

        def update_Back():

            root.destroy()
            seceond_window()

        backbtn = Button(root,
                         font=('times new roman', 11, 'bold'),
                         text="Back",
                         width=11,
                         height=1,
                         fg='white',
                         bg="brown",
                         command=update_Back)
        backbtn.place(x=620, y=10)

        btn = Button(root,
                     font=('times new roman', 10, 'bold'),
                     text="Search",
                     width=11,
                     fg='white',
                     height=1,
                     bg="orange",
                     command=update_appointment)
        btn.place(x=280, y=130)

        root.geometry("840x500+0+0")
        root.resizable(False, False)

        root.mainloop()

    update = Button(root,
                    font=('arial', 9, 'bold'),
                    text="Update appoinment",
                    width=17,
                    fg='white',
                    height=1,
                    bg="orange",
                    command=modify)
    update.place(x=290, y=350)

    root.geometry("870x500+0+0")
    root.resizable(False, False)
    root.mainloop()
Example #11
0
        def update_appointment():
            x = patient_ent.get()

            if x == "":
                tkinter.messagebox.showinfo("Warning ",
                                            "Kindly Enter patient Name")

            else:
                sql = "SELECT * FROM Appointment WHERE Name LIKE ?"

                res = curs.execute(sql, (x, ))

                for i in res:
                    name = i[0]
                    gender = i[1]
                    Age = i[2]
                    Address = i[3]
                    Appoint_time = i[4]

                # print("your age is "+ str(Age))

                details = Label(root,
                                text="your current detaisl are .....",
                                font=('times new roman', 12),
                                fg="grey")
                details.place(x=105, y=164)

                Name = Label(root,
                             text="Name  ",
                             font=('times new roman', 16, 'bold'),
                             fg="steelblue")
                Name.place(x=105, y=190)

                Name_ent = Entry(root, font=('airal', 12, ''), width=30)
                Name_ent.place(x=300, y=185)
                Name_ent.insert(END, name)

                gen = Label(root,
                            text="Gender",
                            font=('times new roman', 16, 'bold'),
                            fg="steelblue")
                gen.place(x=105, y=225)

                gen_ent = Entry(root, font=('arial', 12, ''), width=30)
                gen_ent.place(x=300, y=225)
                gen_ent.insert(END, gender)

                Ages = Label(root,
                             text="Age",
                             font=('times new roman', 16, 'bold'),
                             fg="steelblue")
                Ages.place(x=105, y=268)

                Age_ent = Entry(root, font=('arial', 12, ''), width=30)
                Age_ent.place(x=300, y=268)
                Age_ent.insert(END, Age)

                loc = Label(root,
                            text="Address",
                            font=('times new roman', 16, 'bold'),
                            fg="steelblue")
                loc.place(x=105, y=315)

                Loc_ent = Entry(root, font=('arial', 12, ''), width=30)
                Loc_ent.place(x=300, y=315)
                Loc_ent.insert(END, Address)

                time = Label(root,
                             text="Appointment Time",
                             font=('times new roman', 16, 'bold'),
                             fg="steelblue")
                time.place(x=105, y=357)

                time_ent = Entry(root, font=('freesans', 12, ''), width=30)
                time_ent.place(x=300, y=357)
                time_ent.insert(END, Appoint_time)

            def update():
                val1 = Name_ent.get()
                val2 = gen_ent.get()
                val3 = Age_ent.get()
                val4 = Loc_ent.get()
                val5 = time_ent.get()

                query = "UPDATE  Appointment SET Name=?, Gender=?, Age=?, Address=?, Appoint_time=?  WHERE Name Like?"
                curs.execute(query,
                             (val1, val2, val3, val4, val5, patient_ent.get()))
                conn.commit()

                tkinter.messagebox.showinfo("Update", "Updated Succesfully")

            def delete():

                query2 = "DELETE FROM  Appointment  WHERE Name Like?"
                curs.execute(query2, (patient_ent.get(), ))
                conn.commit()

                tkinter.messagebox.showinfo("Delete", "Deleted Succesfully")

                Name_ent.destroy()
                gen_ent.destroy()
                Age_ent.destroy()
                Loc_ent.destroy()
                time_ent.destroy()

            updbtn = Button(root,
                            font=('times new roman', 10, 'bold'),
                            text="Update",
                            width=11,
                            height=1,
                            fg='white',
                            bg="steelblue",
                            command=update)
            updbtn.place(x=300, y=410)

            delbtn = Button(root,
                            font=('times new roman', 10, 'bold'),
                            text="Delete",
                            width=11,
                            height=1,
                            fg='white',
                            bg="red",
                            command=delete)
            delbtn.place(x=420, y=410)
Example #12
0
# root.geometry("%dx%d+0+0" % (w, h))



app = Frame(root)
app.grid()

customFont = tkFont.Font(family="Cambria", size=30)
helv36 = tkFont.Font(family="Helvetica",size=36,weight="bold" )


time = Text(root)
time.configure(bg='#000000',state=NORMAL, highlightthickness = 0)
time.tag_configure('big', justify = RIGHT, foreground='#ffffff', background="black", font=("Helvetica",36,"bold" ))
time.insert(END, timeNow, 'big')
time.place(x = 1030, y = 10, height=45, width=160)


text = Text(root) #state normal = default makes text area editable diabale after setting contents
text.configure(bg='#000000',state=NORMAL, highlightthickness = 0)
text.tag_configure('big', foreground='#ffffff', background="black", font=("Helvetica",36,"bold" ))
text.insert(END, dateNow, 'big')
text.insert(END, WeatherNow, 'big')
text.configure(state=DISABLED)
# text.pack()
text.place(x = 10, y = 10, height=200, width=900)

stocks = Text(root)
stocks.configure(bg='#000000',state=NORMAL, highlightthickness = 0)
stocks.tag_configure('big', foreground='#ffffff', background="black", font=("Helvetica",36,"bold" ))
stocks.insert(END, Sapple, 'big')