SHOW:
|
|
- or go back to the newest paste.
| 1 | from tkinter import * | |
| 2 | ||
| 3 | class test: | |
| 4 | def __init__(self, root): | |
| 5 | self.variables = [] | |
| 6 | for i in range(26): | |
| 7 | self.variables.append(StringVar()) | |
| 8 | ||
| 9 | self.frames = [] | |
| 10 | self.labels = [] | |
| 11 | self.entrys = [] | |
| 12 | for i in range(2): | |
| 13 | self.frames.append(Frame(root)) | |
| 14 | for ii in range(26): | |
| 15 | char = str(chr(ord('A') + ii))
| |
| 16 | if i == 0: | |
| 17 | self.labels.append(Label(self.frames[0] , text = char)) | |
| 18 | self.labels[-1].grid(padx=0, pady=0, row=ii, column=i) | |
| 19 | else: | |
| 20 | self.entrys.append(Entry(self.frames[1], textvariable =self.variables[ii])) | |
| 21 | self.entrys[-1].grid(padx=0, pady=0, row=ii, column=i) | |
| 22 | self.frames[i].grid(row = 0,column=i) | |
| 23 | ||
| 24 | root = Tk() | |
| 25 | - | root.geometry("250x500+250+250")
|
| 25 | + | root.geometry("200x600+50+50")
|
| 26 | T = test(root) | |
| 27 | root.mainloop() |