table of input fieldsdefault tk root window from tkinter import rows [for in range( )cols [for in range( )ent entry(relief=ridgeent grid(row=icolumn=jsticky=nsewent insert(end'% % (ij)cols append(entrows append(colsdef onpress()for row in rowsfor col in rowprint(col get()end='print(button(text='fetch'command=onpressgrid(mainloop(when runthis script creates the window in figure - and saves away all the grid' entry field widgets in two-dimensional list of lists when its fetch button is pressedthe script steps through the saved list of lists of entry widgetsto fetch and display all the current values in the grid here is the output of two fetch presses--one before made input field changesand one afterc:\pp \gui\tour\gridpython grid py now that we know how to build and step through arrays of input fieldslet' add few more useful buttons example - adds another row to display column sums and adds buttons to clear all fields to zero and calculate column sums example - pp \gui\tour\grid\grid py add column sumsclearing from tkinter import numrownumcol grids