Advertisement
here2share

# Tk_worksheet.py

May 23rd, 2018
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.43 KB | None | 0 0
  1. # Tk_worksheet.py
  2.  
  3. from Tkinter import *
  4.  
  5. rows = []
  6. for i in range(7):
  7.     cols = []
  8.     for j in range(5):
  9.         e = Entry(relief=RIDGE)
  10.         e.grid(row=i, column=j, sticky=NSEW)
  11.         e.insert(END, '%d.%d' % (i, j))
  12.         cols.append(e)
  13.     rows.append(cols)
  14.  
  15. def onPress():
  16.     for row in rows:
  17.         for col in row:
  18.             print col.get(),' ',
  19.         print
  20.     print
  21.  
  22. print rows[1][2].get()
  23. print
  24.  
  25. Button(text='Fetch Data', command=onPress).grid()
  26. mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement