Çok uzun olduğu için karmaşıklık olmaması adına öyle yapmıştım. Kodun tamamamı;
from tkinter import *
from openpyxl import *
window = Tk()
window.title("Demo")
#pencere
window.configure(bg="#aedb9f", width=980, height=500)
window.resizable(width=False, height=False)
#labeller
lbl_baslik = Label(window, text="EBA DESTEK NOKTASI TAKİP PROGRAMI - ŞEHİT MAHMUTBEY ORTAOKULU")
lbl_baslik.place(x=0, y=0)
lbl_baslik.config(font=("Courier", 20),bg="#ffc400")
lbl_ogrno = Label(window, text="Ögrenci No")
lbl_ogrno.place(x=0, y=50)
lbl_ogrno.config(font='Helvetica 20 bold',bg="#aedb9f")
lbl_ograd = Label(window, text="Ad Soyad")
lbl_ograd.place(x=0, y=100)
lbl_ograd.config(font='Helvetica 20 bold',bg="#aedb9f")
lbl_ogrokul = Label(window, text="Okulu")
lbl_ogrokul.place(x=0, y=150)
lbl_ogrokul.config(font='Helvetica 20 bold',bg="#aedb9f")
lbl_sinif = Label(window, text="Sınıf")
lbl_sinif.place(x=0, y=200)
lbl_sinif.config(font='Helvetica 20 bold',bg="#aedb9f")
lbl_tarih = Label(window, text="Tarih")
lbl_tarih.place(x=0, y=250)
lbl_tarih.config(font='Helvetica 20 bold',bg="#aedb9f")
lbl_bassaati = Label(window, text="Başlama Saati")
lbl_bassaati.place(x=0, y=300)
lbl_bassaati.config(font='Helvetica 20 bold',bg="#aedb9f")
lbl_bitsaati = Label(window, text="Bitiş Saati")
lbl_bitsaati.place(x=0, y=350)
lbl_bitsaati.config(font='Helvetica 20 bold',bg="#aedb9f")
lbl_arama = Label(window, text="Öğrenci Arama")
lbl_arama.place(x=650, y=60)
lbl_arama.config(font='Helvetica 20 bold',bg="#aedb9f")
lbl_arananno = Label(window, text="Öğrenci No")
lbl_arananno.place(x=550, y=120)
lbl_arananno.config(font='Helvetica 20 bold',bg="#aedb9f")
#text kutuları
ogrno = StringVar()
text_ogrno = Entry(window, textvariable=ogrno, width=25, font='Helvetica 14 bold', fg='blue')
text_ogrno.place(x=250, y=60)
ograd = StringVar()
text_ograd = Entry(window, textvariable=ograd, width=25, font='Helvetica 14 bold', fg='blue')
text_ograd.place(x=250, y=110)
ogrokul = StringVar()
text_ogrokul = Entry(window, textvariable=ogrokul, width=25, font='Helvetica 14 bold', fg='blue')
text_ogrokul.place(x=250, y=160)
ogrsinif = StringVar()
text_ogrsinif = Entry(window, textvariable=ogrsinif, width=25, font='Helvetica 14 bold', fg='blue')
text_ogrsinif.place(x=250, y=210)
#takvim
tarih = StringVar()
text_tarih = Entry(window, textvariable=tarih, width=25, font='Helvetica 14 bold', fg='blue')
text_tarih.place(x=250, y=260)
bassaati = StringVar()
text_bassaati = Entry(window, textvariable=bassaati, width=25, font='Helvetica 14 bold', fg='blue')
text_bassaati.place(x=250, y=310)
bitsaati = StringVar()
text_bitsaati = Entry(window, textvariable=bitsaati, width=25, font='Helvetica 14 bold', fg='blue')
text_bitsaati.place(x=250, y=360)
aranan_no = StringVar()
arama_ogrno = Entry(window, textvariable=aranan_no, width=5, font='Helvetica 14 bold', fg='blue')
arama_ogrno.place(x=725, y=130)
#temizle fonksiyonu
def text_temizle():
ogrno.set("")
ograd.set("")
ogrokul.set("")
ogrsinif.set("")
tarih.set("")
bassaati.set("")
bitsaati.set("")
#butonlar
btn_kayit = Button(window, text="KAYDET", font='Helvetica 15 bold', bg="green", width=10)
btn_kayit.place(x=250, y=400)
book = load_workbook('Desktop/EBA DESTEK ODASI ÖĞRENCİ TAKİP/Kayit Defteri.xlsx')
sheet = book.active
def excele_ata():
temp_kayitsayisi = sheet['j1'].value + 1
sheet.cell(row=temp_kayitsayisi+1, column=1).value = temp_kayitsayisi
temp = [ogrno, ograd, ogrokul, tarih, ogrsinif, bassaati, bitsaati]
for i in range(7):
sheet.cell(row=temp_kayitsayisi+1, column=i+2).value = temp[i].get()
sheet['j1'].value = temp_kayitsayisi
book.save('Desktop/EBA DESTEK ODASI ÖĞRENCİ TAKİP/Kayit Defteri.xlsx')
text_temizle()
btn_kayit.configure(command=excele_ata)
btn_temizle = Button(window, text="TEMİZLE", font='Helvetica 15 bold', bg="yellow", width=10)
btn_temizle.place(x=400, y=400)
btn_temizle.configure(command=text_temizle)
#buton arama
def ogrenci_ara():
temp_kayitsayisi = sheet['j1'].value + 1
temp_kayitlar = []
temp_veriler = list()
temp_text = "NO AD_SOYAD OKUL SINIF TARİH BAŞ BİT"
temp_veriler.append(temp_text)
for i in range(2, temp_kayitsayisi+1):
if sheet.cell(row=i, column=2).value == aranan_no.get():
temp_kayitlar.append(i)
for t in temp_kayitlar:
temp = ""
for i in range(2, 8):
temp = temp + " " + str(sheet.cell(row=t, column=i).value)
temp_veriler.append(temp)
lbl_b = StringVar()
lbl_bulunanlar = Label(window, textvariable=lbl_b)
lbl_bulunanlar.place(x=550, y=180)
lbl_b.set("")
tempp = ""
for i in range(len(temp_veriler)):
tempp += "\n" + temp_veriler[i]
lbl_b.set("")
lbl_b.set(tempp)
print(temp_kayitlar)
print(temp_veriler)
btn_arama = Button(window, text="ÖĞRENCİ BUL", font='Helvetica 15 bold', bg="grey", command=ogrenci_ara)
btn_arama.place(x=800, y=120)
window.mainloop()