I am learning how to use tktable. I made a table and put some data in it which appeared. I want to put it into a loop and change the data 5 or 6 times. Right now I am just putting simple data in until I get it to work correctly, just to verify the tables is updated. Later I will put specific data.
My problem though is, I create the array, fill it, pack it, then change the data, pack it, change, and then pack, but it only ever shows the last values that were in the array, not the earlier ones. I even put a sleep command to wait a few seconds between instances, and that prints. Does anyone know what I am doing wrong? Code is below. The sets of dots are printing every second. But it shows only one array with 9*row, 9*column. It should show the array change each time before the three dots (...) are printed.
Code:
----------
My problem though is, I create the array, fill it, pack it, then change the data, pack it, change, and then pack, but it only ever shows the last values that were in the array, not the earlier ones. I even put a sleep command to wait a few seconds between instances, and that prints. Does anyone know what I am doing wrong? Code is below. The sets of dots are printing every second. But it shows only one array with 9*row, 9*column. It should show the array change each time before the three dots (...) are printed.
Code:
----------
Code:
from Tkinter import *
from tktable import *
from time import *
root = Tk()
var = ArrayVar(root)
t = Table(flashmode=1,variable=var)
for z in range(10):
for y in range(10):
for x in range(10):
index = "%i,%i" % (y, x)
index2 = "%i,%i" % (z*y, z*x)
var[index] = index2
t.variable = var
t.pack()
sleep(1)
print "... "
root = Tk()
root.mainloop()
Comment