Untitled

mail@pastecode.io avatar
unknown
plain_text
2 months ago
25 kB
8
Indexable
Never
from tkinter import *
from datetime import datetime,timedelta
window = Tk()
window.geometry("1200x1200")
def secimyap(*args):
    aktifkonf = 0
    secilen = sval.get()
    if secilen == optionlist[0]:
        aktifkonf = 1
    elif secilen == optionlist[1]:
        aktifkonf = 2
    elif secilen == optionlist[2]:
        aktifkonf = 3
    elif secilen == optionlist[3]:
        aktifkonf = 4
    elif secilen == optionlist[4]:
        aktifkonf = 5
    elif secilen == optionlist[5]:
        aktifkonf = 6
    elif secilen == optionlist[6]:
        aktifkonf = 7
    elif secilen == optionlist[7]:
        aktifkonf = 8
    elif secilen == optionlist[8]:
        aktifkonf = 9
    elif secilen == optionlist[9]:
        aktifkonf = 10
    return aktifkonf

sval = StringVar(value="Aktif Konfigurasyonu seciniz")
optionlist = ["16inis 17inis-kalkıs 18kalkıs",
              "16inis 17inis 18kalkıs",
              "17inis-kalkıs 18inis-kalkıs",
              "17inis-kalkıs 18inis",
              "17inis 18inis-kalkıs",
              "34inis 35inis-kalkıs 36kalkıs",
              "34inis 35inis 36kalkıs",
              "35inis-kalkıs 36inis-kalkıs",
              "35inis-kalkıs 36inis",
              "35inis 36inis-kalkıs"]
opm = OptionMenu(window,sval,*optionlist)
opm.config(width=25,height=1)
opm.pack(side=LEFT,anchor=N)

listebox = Listbox(window)
listebox.place(relx=0.3,rely=0.05,relheight=0.7,relwidth=0.3)
listebox2 = Listbox(window)
listebox2.place(relx=0.62,rely=0.05,relheight=0.7,relwidth=0.3)
sval.trace("w", secimyap)

biraltiinis=[1150,1000,1300,1350,1400,1450,1500]
ucdortinis=[1250,1100,1400,1450,1500,1550,1600]
biryediinis=[300,450,400,450,500,550,600]
ucbesinis=[400,550,500,550,600,650,700]
birsekizinis=[450,750,400,350,300,250,150]
ucaltiinis=[600,850,550,500,450,400,350]

aktifkonf = secimyap()
dosya = open("gelentrafikler.txt","r",encoding="utf-8")
dosyaoku = dosya.readlines()
while True:
    for i in dosyaoku:
        ssss = i.split(",")[3].strip().strip('["').strip('"]')
        prkyeri = i.split(",")[1].strip().strip('["').strip('"]')
        girisnoktas = i.split(",")[2].strip().strip('["').strip('"]')
        callsign = i.split(",")[0].strip().strip('["').strip('"]')
        noktatahmini = datetime.strptime(ssss, "%H:%M:%S")
        k = datetime.now()
        kalansure = (noktatahmini - k).seconds

        if kalansure >= 400:
            if aktifkonf == 1:

                atananparkyeri = prkyeri
                if atananparkyeri == "E5":
                    if (biraltiinis[1]) < (biryediinis[1]):
                        print("burada")
                        listebox.insert(END, callsign)
                        del i
                    else:
                        listebox2.insert(END, callsign)
                        del i

                if atananparkyeri == "NW":
                    if (biraltiinis[0]) < (biryediinis[0]):
                        listebox.insert(END, callsign)
                        del i
                    else:
                        listebox2.insert(END, callsign)
                        del i
                if atananparkyeri == "T3":
                    if (biraltiinis[2]) < (biryediinis[2]):
                        listebox.insert(END, callsign)
                        del i
                    else:
                        listebox2.insert(END, callsign)
                        del i
                if atananparkyeri == "T5":
                    if (biraltiinis[3]) < (biryediinis[3]):
                        listebox.insert(END, callsign)
                        del i
                    else:
                        listebox2.insert(END, callsign)
                        del i
                if atananparkyeri == "T7":
                    if (biraltiinis[4]) < (biryediinis[4]):
                        listebox.insert(END, callsign)
                        del i
                    else:
                        listebox2.insert(END, callsign)
                        del i
                if atananparkyeri == "T9":
                    if (biraltiinis[5]) < (biryediinis[5]):
                        listebox.insert(END, callsign)
                        del i
                    else:
                        listebox2.insert(END, callsign)
                        del i
                if atananparkyeri == "NE":
                    if (biraltiinis[6]) < (biryediinis[6]):
                        listebox.insert(END, callsign)
                        del i
                    else:
                        listebox2.insert(END, callsign)
                        del i
            if aktifkonf == 2:
                atananparkyeri = prkyeri
                if atananparkyeri == "E5":
                    if (biraltiinis[1]) < (biryediinis[1]):
                        listebox.insert(END, callsign)
                        del i
                    else:
                        listebox2.insert(END, callsign)
                        del i

                if atananparkyeri == "NW":
                    if (biraltiinis[0]) < (biryediinis[0]):
                        listebox.insert(END, callsign)
                        del i
                    else:
                        listebox2.insert(END, callsign)
                        del i
                if atananparkyeri == "T3":
                    if (biraltiinis[2]) < (biryediinis[2]):
                        listebox.insert(END, callsign)
                        del i
                    else:
                        listebox2.insert(END, callsign)
                        del i
                if atananparkyeri == "T5":
                    if (biraltiinis[3]) < (biryediinis[3]):
                        listebox.insert(END, callsign)
                        del i
                    else:
                        listebox2.insert(END, callsign)
                        del i
                if atananparkyeri == "T7":
                    if (biraltiinis[4]) < (biryediinis[4]):
                        listebox.insert(END, callsign)
                        del i
                    else:
                        listebox2.insert(END, callsign)
                        del i
                if atananparkyeri == "T9":
                    if (biraltiinis[5]) < (biryediinis[5]):
                        listebox.insert(END, callsign)
                        del i
                    else:
                        listebox2.insert(END, callsign)
                        del i
                if atananparkyeri == "NE":
                    if (biraltiinis[6]) < (biryediinis[6]):
                        listebox.insert(END, callsign)
                        del i
                    else:
                        listebox2.insert(END, callsign)
                        del i
            if aktifkonf == 3:
                atananparkyeri = prkyeri
                if atananparkyeri == "E5":
                    if (biryediinis[1]) < (birsekizinis[1]):
                        listebox.insert(END, callsign)
                        del i
                    else:
                        listebox2.insert(END, callsign)
                        del i
                if atananparkyeri == "NW":
                    if (biryediinis[0]) < (birsekizinis[0]):
                        listebox.insert(END, callsign)
                        del i
                    else:
                        listebox2.insert(END, callsign)
                        del i
                if atananparkyeri == "T3":
                    if (biryediinis[2]) < (birsekizinis[2]):
                        listebox.insert(END, callsign)
                        del i
                    else:
                        listebox2.insert(END, callsign)
                        del i
                if atananparkyeri == "T5":
                    if (biryediinis[3]) < (birsekizinis[3]):
                        listebox.insert(END, callsign)
                        del i
                    else:
                        listebox2.insert(END, callsign)
                        del i
                if atananparkyeri == "T7":
                    if (biryediinis[4]) < (birsekizinis[4]):
                        listebox.insert(END, callsign)
                        del i
                    else:
                        listebox2.insert(END, callsign)
                        del i
                if atananparkyeri == "T9":
                    if (biryediinis[5]) < (birsekizinis[5]):
                        listebox.insert(END, callsign)
                        del i
                    else:
                        listebox2.insert(END, callsign)
                        del i
                if atananparkyeri == "NE":
                    if (biryediinis[6]) < (birsekizinis[6]):
                        listebox.insert(END, callsign)
                        del i
                    else:
                        listebox2.insert(END, callsign)
                        del i
            if aktifkonf == 4:
                atananparkyeri = prkyeri
                if atananparkyeri == "E5":
                    if (biryediinis[1]) < (birsekizinis[1]):
                        listebox.insert(END, callsign)
                        del i
                    else:
                        listebox2.insert(END, callsign)
                        del i
                if atananparkyeri == "NW":
                    if (biryediinis[0]) < (birsekizinis[0]):
                        listebox.insert(END, callsign)
                        del i
                    else:
                        listebox2.insert(END, callsign)
                        del i
                if atananparkyeri == "T3":
                    if (biryediinis[2]) < (birsekizinis[2]):
                        listebox.insert(END, callsign)
                        del i
                    else:
                        listebox2.insert(END, callsign)
                        del i
                if atananparkyeri == "T5":
                    if (biryediinis[3]) < (birsekizinis[3]):
                        listebox.insert(END, callsign)
                        del i
                    else:
                        listebox2.insert(END, callsign)
                        del i
                if atananparkyeri == "T7":
                    if (biryediinis[4]) < (birsekizinis[4]):
                        listebox.insert(END, callsign)
                        del i
                    else:
                        listebox2.insert(END, callsign)
                        del i
                if atananparkyeri == "T9":
                    if (biryediinis[5]) < (birsekizinis[5]):
                        listebox.insert(END, callsign)
                        del i
                    else:
                        listebox2.insert(END, callsign)
                        del i
                if atananparkyeri == "NE":
                    if (biryediinis[6]) < (birsekizinis[6]):
                        listebox.insert(END, callsign)
                        del i
                    else:
                        listebox2.insert(END, callsign)
                        del i
            if aktifkonf == 5:
                atananparkyeri = prkyeri
                if atananparkyeri == "E5":
                    if (biryediinis[1]) < (birsekizinis[1]):
                        listebox.insert(END, callsign)
                        del i
                    else:
                        listebox2.insert(END, callsign)
                        del i
                if atananparkyeri == "NW":
                    if (biryediinis[0]) < (birsekizinis[0]):
                        listebox.insert(END, callsign)
                        del i
                    else:
                        listebox2.insert(END, callsign)
                        del i
                if atananparkyeri == "T3":
                    if (biryediinis[2]) < (birsekizinis[2]):
                        listebox.insert(END, callsign)
                        del i
                    else:
                        listebox2.insert(END, callsign)
                        del i
                if atananparkyeri == "T5":
                    if (biryediinis[3]) < (birsekizinis[3]):
                        listebox.insert(END, callsign)
                        del i
                    else:
                        listebox2.insert(END, callsign)
                        del i
                if atananparkyeri == "T7":
                    if (biryediinis[4]) < (birsekizinis[4]):
                        listebox.insert(END, callsign)
                        del i
                    else:
                        listebox2.insert(END, callsign)
                        del i
                if atananparkyeri == "T9":
                    if (biryediinis[5]) < (birsekizinis[5]):
                        listebox.insert(END, callsign)
                        del i
                    else:
                        listebox2.insert(END, callsign)
                        del i
                if atananparkyeri == "NE":
                    if (biryediinis[6]) < (birsekizinis[6]):
                        listebox.insert(END, callsign)
                        del i
                    else:
                        listebox2.insert(END, callsign)
                        del i
            if aktifkonf == 6:
                atananparkyeri = prkyeri
                if atananparkyeri == "E5":
                    if (ucdortinis[1]) < (ucbesinis[1]):
                        listebox.insert(END, callsign)
                        del i
                    else:
                        listebox2.insert(END, callsign)
                        del i
                if atananparkyeri == "NW":
                    if (ucdortinis[0]) < (ucbesinis[0]):
                        listebox.insert(END, callsign)
                        del i
                    else:
                        listebox2.insert(END, callsign)
                        del i
                if atananparkyeri == "T3":
                    if (ucdortinis[2]) < (ucbesinis[2]):
                        listebox.insert(END, callsign)
                        del i
                    else:
                        listebox2.insert(END, callsign)
                        del i
                if atananparkyeri == "T5":
                    if (ucdortinis[3]) < (ucbesinis[3]):
                        listebox.insert(END, callsign)
                        del i
                    else:
                        listebox2.insert(END, callsign)
                        del i
                if atananparkyeri == "T7":
                    if (ucdortinis[4]) < (ucbesinis[4]):
                        listebox.insert(END, callsign)
                        del i
                    else:
                        listebox2.insert(END, callsign)
                        del i
                if atananparkyeri == "T9":
                    if (ucdortinis[5]) < (ucbesinis[5]):
                        listebox.insert(END, callsign)
                        del i
                    else:
                        listebox2.insert(END, callsign)
                        del i
                if atananparkyeri == "NE":
                    if (ucdortinis[6]) < (ucbesinis[6]):
                        listebox.insert(END, callsign)
                        del i
                    else:
                        listebox2.insert(END, callsign)
                        del i
            if aktifkonf == 7:
                atananparkyeri = prkyeri
                if atananparkyeri == "E5":
                    if (ucdortinis[1]) < (ucbesinis[1]):
                        listebox.insert(END, callsign)
                        del i
                    else:
                        listebox2.insert(END, callsign)
                        del i
                if atananparkyeri == "NW":
                    if (ucdortinis[0]) < (ucbesinis[0]):
                        listebox.insert(END, callsign)
                        del i
                    else:
                        listebox2.insert(END, callsign)
                        del i
                if atananparkyeri == "T3":
                    if (ucdortinis[2]) < (ucbesinis[2]):
                        listebox.insert(END, callsign)
                        del i
                    else:
                        listebox2.insert(END, callsign)
                        del i
                if atananparkyeri == "T5":
                    if (ucdortinis[3]) < (ucbesinis[3]):
                        listebox.insert(END, callsign)
                        del i
                    else:
                        listebox2.insert(END, callsign)
                        del i
                if atananparkyeri == "T7":
                    if (ucdortinis[4]) < (ucbesinis[4]):
                        listebox.insert(END, callsign)
                        del i
                    else:
                        listebox2.insert(END, callsign)
                        del i
                if atananparkyeri == "T9":
                    if (ucdortinis[5]) < (ucbesinis[5]):
                        listebox.insert(END, callsign)
                        del i
                    else:
                        listebox2.insert(END, callsign)
                        del i
                if atananparkyeri == "NE":
                    if (ucdortinis[6]) < (ucbesinis[6]):
                        listebox.insert(END, callsign)
                        del i
                    else:
                        listebox2.insert(END, callsign)
                        del i
            if aktifkonf == 8:
                atananparkyeri = prkyeri
                if atananparkyeri == "E5":
                    if (ucbesinis[1]) < (ucaltiinis[1]):
                        listebox.insert(END, callsign)
                        del i
                    else:
                        listebox2.insert(END, callsign)
                        del i
                if atananparkyeri == "NW":
                    if (ucbesinis[0]) < (ucaltiinis[0]):
                        listebox.insert(END, callsign)
                        del i
                    else:
                        listebox2.insert(END, callsign)
                        del i
                if atananparkyeri == "T3":
                    if (ucbesinis[2]) < (ucaltiinis[2]):
                        listebox.insert(END, callsign)
                        del i
                    else:
                        listebox2.insert(END, callsign)
                        del i
                if atananparkyeri == "T5":
                    if (ucbesinis[3]) < (ucaltiinis[3]):
                        listebox.insert(END, callsign)
                        del i
                    else:
                        listebox2.insert(END, callsign)
                        del i
                if atananparkyeri == "T7":
                    if (ucbesinis[4]) < (ucaltiinis[4]):
                        listebox.insert(END, callsign)
                        del i
                    else:
                        listebox2.insert(END, callsign)
                        del i
                if atananparkyeri == "T9":
                    if (ucbesinis[5]) < (ucaltiinis[5]):
                        listebox.insert(END, callsign)
                        del i
                    else:
                        listebox2.insert(END, callsign)
                        del i
                if atananparkyeri == "NE":
                    if (ucbesinis[6]) < (ucaltiinis[6]):
                        listebox.insert(END, callsign)
                        del i
                    else:
                        listebox2.insert(END, callsign)
                        del i
            if aktifkonf == 9:
                atananparkyeri = prkyeri
                if atananparkyeri == "E5":
                    if (ucbesinis[1]) < (ucaltiinis[1]):
                        listebox.insert(END, callsign)
                        del i
                    else:
                        listebox2.insert(END, callsign)
                        del i
                if atananparkyeri == "NW":
                    if (ucbesinis[0]) < (ucaltiinis[0]):
                        listebox.insert(END, callsign)
                        del i
                    else:
                        listebox2.insert(END, callsign)
                        del i
                if atananparkyeri == "T3":
                    if (ucbesinis[2]) < (ucaltiinis[2]):
                        listebox.insert(END, callsign)
                        del i
                    else:
                        listebox2.insert(END, callsign)
                        del i
                if atananparkyeri == "T5":
                    if (ucbesinis[3]) < (ucaltiinis[3]):
                        listebox.insert(END, callsign)
                        del i
                    else:
                        listebox2.insert(END, callsign)
                        del i
                if atananparkyeri == "T7":
                    if (ucbesinis[4]) < (ucaltiinis[4]):
                        listebox.insert(END, callsign)
                        del i
                    else:
                        listebox2.insert(END, callsign)
                        del i
                if atananparkyeri == "T9":
                    if (ucbesinis[5]) < (ucaltiinis[5]):
                        listebox.insert(END, callsign)
                        del i
                    else:
                        listebox2.insert(END, callsign)
                        del i
                if atananparkyeri == "NE":
                    if (ucbesinis[6]) < (ucaltiinis[6]):
                        listebox.insert(END, callsign)
                        del i
                    else:
                        listebox2.insert(END, callsign)
                        del i
            if aktifkonf == 10:
                atananparkyeri = prkyeri
                if atananparkyeri == "E5":
                    if (ucbesinis[1]) < (ucaltiinis[1]):
                        listebox.insert(END, callsign)
                        del i
                    else:
                        listebox2.insert(END, callsign)
                        del i
                if atananparkyeri == "NW":
                    if (ucbesinis[0]) < (ucaltiinis[0]):
                        listebox.insert(END, callsign)
                        del i
                    else:
                        listebox2.insert(END, callsign)
                        del i
                if atananparkyeri == "T3":
                    if (ucbesinis[2]) < (ucaltiinis[2]):
                        listebox.insert(END, callsign)
                        del i
                    else:
                        listebox2.insert(END, callsign)
                        del i
                if atananparkyeri == "T5":
                    if (ucbesinis[3]) < (ucaltiinis[3]):
                        listebox.insert(END, callsign)
                        del i
                    else:
                        listebox2.insert(END, callsign)
                        del i
                if atananparkyeri == "T7":
                    if (ucbesinis[4]) < (ucaltiinis[4]):
                        listebox.insert(END, callsign)
                        del i
                    else:
                        listebox2.insert(END, callsign)
                        del i
                if atananparkyeri == "T9":
                    if (+ ucbesinis[5]) < (ucaltiinis[5]):
                        listebox.insert(END, callsign)
                        del i
                    else:
                        listebox2.insert(END, callsign)
                        del i
                if atananparkyeri == "NE":
                    if (ucbesinis[6]) < (ucaltiinis[6]):
                        listebox.insert(END, callsign)
                        del i
                    else:
                        listebox2.insert(END, callsign)
                        del i



    window.mainloop()
Leave a Comment