-
Notifications
You must be signed in to change notification settings - Fork 1
/
tkinter_test.py
43 lines (30 loc) · 1.01 KB
/
tkinter_test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Feb 27 09:59:30 2020
@author: siddhi
"""
import tkinter as tk
def show_entry_fields():
print("First Name: %s\nLast Name: %s" % (e1.get(), e2.get()))
Id=int(e1.get())
name=e2.get()
master = tk.Tk()
tk.Label(master, text="First Name").grid(row=0)
tk.Label(master, text="Last Name").grid(row=1)
e1 = tk.Entry(master)
e2 = tk.Entry(master)
e1.grid(row=0, column=1)
e2.grid(row=1, column=1)
tk.Button(master,
text='Quit',
command=master.quit).grid(row=3,
column=0,
sticky=tk.W,
pady=4)
tk.Button(master, text='Show', command=show_entry_fields).grid(row=3,
column=1,
sticky=tk.W,
pady=4)
master.mainloop()
tk.mainloop()