tkinter_tutorial_4.py (331B)
1 from Tkinter import * 2 3 root = Tk() 4 5 label_1 = Label(root, text="Name") 6 label_2 = Label(root, text="Password") 7 entry_1 = Entry(root) 8 entry_2 = Entry(root) 9 10 label_1.grid(row=0, column = 0) 11 label_2.grid(row=1) # column = 0 by default 12 13 entry_1.grid(row = 0, column = 1) 14 entry_2.grid(row = 1, column = 1) 15 16 root.mainloop()