Merhaba tekrardan;
Sabah bir sorun paylaşmıştım sağollsun bir arkadaş çözüm konusunda bilgi verdi;
Sabah ki konu
Ve benim fonksiyona uyarladığımda bir sorunum var. Fonksiyon şu şekilde;
def module():
icerik1 = tk.Tk()
icerik1.title("2 Personel Hesaplama")
icerik1.geometry('500x350+750+350')
icerik1.resizable(width="FALSE", height="FALSE")
liste2 = []
kriterlist2 = ["MO", "YP", "SK", "TY", "BB", "REF", "TED", "PGS", "KDS", "YSE", "OYB", "KB"]
for i in range(len(kriterlist2)):
liste2.append(Label(icerik1, text=kriterlist2[i], font=('arial', 8, 'bold'), bg="green", fg="white"))
sayac = 0
for i in range(1, 13):
liste2[sayac].place(x=70 + i * 30, y=70)
sayac += 1
personel = []
girdiler = []
x2 = 0
y2 = 0
satir, sutun = (2, 12)
for i in range(satir):
personel.append([])
girdiler.append([])
for j in range(sutun):
personel[i].append(StringVar())
girdiler[i].append(Entry(icerik1, textvariable=personel[i][j], width=3))
girdiler[i][j].place(x=100 + x2, y=100 + y2)
x2 += 30
y2 += 30
x2 = 0
matrix = []
def solve():
matrix = []
for i in range(satir):
matrix.append([])
for j in range(sutun):
matrix[i].append(personel[i][j].get())
print(matrix)
weights = [0.3599, 0.05917, 0.1459, 0.36, 0.0123, 0.007, 0.0778, 0.1619, 0.0225, 0.0123, 0.0749, 0.0304]
criterion = [True, True, True, True, True, True, True, True, True, True, True, True]
value2 = TOPSIS(matrix, weights, criterion)
value2.hesaplama()
information2 = tk.Tk()
information2.title("sonuclar")
information2.geometry('200x200+650+350')
list2 = []
list2 = value2.alternatifsiralamasi()
informationscreen2 = tk.Label(information2, text=" SONUÇ KISMI ", bg="green", fg="white")
informationscreen2.pack()
sonucbilgisi2 = tk.Label(information2, text="En iyi alternatif PERSONEL{}: 'dir. ".format(list2[0]),
bg="green", fg="white")
siralamabilgisi2 = tk.Label(information2,
text="Sıralama şu şekildedir;\n PERSONEL {} \n PERSONEL {} 'dir.".format(
list2[0], list2[1]), bg="green", fg="white")
sonucbilgisi2.pack()
siralamabilgisi2.pack()
print(matrix)
tip1 =tk.Label(icerik1,text="Personel1 =: ", font=('arial', 9, 'bold'), bg="white")
tip1.place(x=15,y=100)
tip2 =tk.Label(icerik1,text="Personel2 =: ", font=('arial', 9, 'bold'), bg="white")
tip2.place(x=15,y=130)
buton = tk.Button(icerik1,text="HESAPLA",command=solve)
buton.place(x=220,y=220)
icerik1.mainloop()
Kod bu şekilde, bunu kendi olduğu class icerisinde x.module() şeklinde çalıştırdığım zaman sorunsuz olarak verileri alıyor ve işlemi yapıyor. Fakat şöyle bir sorun var arayüzü oluşturduğum classtan cekmeye calıstığımda verileri girmiyor. Nedenini bilen var mıdır aranızda ?
Aşağıya tam hallerinin haste sitesinden ekliyorum.
Personel fonksiyonlarını burada tutmak istedim
https://hastebin.com/ucilaqahoc.apache
Topsis fonksiyonu burda
https://hastebin.com/axejofazuz.rb
Arayüziçin oluşturduğum kısım