0
我有一個基本上旨在提取多維列表到表中的python tkinter代碼。以下是我的:Python Tkinter表,內容不顯示
from Tkinter import *
def mainApp(Output):
RRColor = '#%02x%02x%02x' % (0, 73,144);
mGui = Tk();
mGui.title('Relational Table');
mGui.configure(background='grey')
text = StringVar();
title1 = Label(mGui, text = 'Premise', fg=RRColor, borderwidth=2).grid(row=0, column=0, sticky="nsew", padx=1, pady=1)
title2 = Label(mGui, text = 'Conclusion', fg=RRColor, borderwidth=2).grid(row=0, column=1, sticky="nsew", padx=1, pady=1)
title3 = Label(mGui, text = 'Support', fg=RRColor, borderwidth=2).grid(row=0, column=2, sticky="nsew", padx=1, pady=1)
title4 = Label(mGui, text = 'Confidence', fg=RRColor, borderwidth=2).grid(row=0, column=3, sticky="nsew", padx=1, pady=1)
title5 = Label(mGui, text = 'Lift', fg=RRColor, borderwidth=2).grid(row=0, column=4, sticky="nsew", padx=1, pady=1)
for col in range(len(Output)):
for row in range(len(Output[0])):
text.set(Output[col][row])
content = Label(mGui, textvariable=text, borderwidth=2, fg =RRColor, bg = 'white')
content.grid(row=row+1, column=col, sticky='NSEW', padx=1, pady=1)
mGui.mainloop();
我從別的地方打電話給這個。我想知道爲什麼內容沒有顯示在網格上。我檢查了輸出成功傳遞給了這個。誰能幫我?
您的代碼有縮進錯誤,因此無法確定您想要代碼執行的操作。 –