-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSomeBasicGUIs.py
More file actions
61 lines (53 loc) · 1.11 KB
/
SomeBasicGUIs.py
File metadata and controls
61 lines (53 loc) · 1.11 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import tkinter as tk
r=tk.Tk()
r.title('Counting seconds')
button=tk.Button(r,text='Stop',width=25,command=r.destroy)
button.grid()
#button.pick()
r.mainloop()
#%%
from tkinter import *
master=Tk()
w=Canvas(master,width=40,height=60)
w.pack()
canvas_height=20
canvas_width=200
y=int(canvas_height/2)
w.create_line(0,y,canvas_width,100)
#w.create_line(0,y,canvas_width,y)
mainloop()
#%%
from tkinter import *
root=Tk()
T=Text(root,height=2,width=30)
T.pack()
T.insert(END,'DDU\nDHARMSIMH DESAI UNIVERSITY')
mainloop()
#%%
from tkinter import *
top=Tk()
Lb=Listbox(top)
Lb.insert(1,'Python')
Lb.insert(2,'Java')
Lb.insert(3,'C++')
Lb.insert(4,'Any other')
Lb.pack()
top.mainloop()
#%%
from tkinter import *
def submit():
first_name=a1.get()
last_name=a2.get()
print("First name:",first_name)
print("Last name:",last_name)
master.destroy()
master=Tk()
Label(master,text='First name').grid(row=0)
Label(master,text='Last Name').grid(row=1)
a1=Entry(master)
a2=Entry(master)
a1.grid(row=0,column=1)
a2.grid(row=1,column=1)
w=Button(master,text='Enter',width=20,command=submit)
w.grid(row=2,column=1)
mainloop()