-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmyscript_4.py
More file actions
53 lines (34 loc) · 943 Bytes
/
Copy pathmyscript_4.py
File metadata and controls
53 lines (34 loc) · 943 Bytes
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
import tkinter as tk
from tkinter import ttk
def button_func():
print("A button was clicked")
def exercise_button_func():
print("hello")
# creating window
window = tk.Tk()
window.title("Window and Widgets")
window.geometry("800x500")
# ttk label
label = ttk.Label(master=window,
text="This is a text")
label.pack()
# tk text
text_box = tk.Text(master=window)
text_box.pack()
# ttk entry
entry = ttk.Entry(master=window)
entry.pack(pady=5)
exercise_label = ttk.Label(master=window,
text="My Label")
exercise_label.pack()
# ttk button
button = ttk.Button(master=window,
text="Button",
command=button_func)
button.pack()
exercise_button = ttk.Button(master=window,
text="exercise button",
command=exercise_button_func)
exercise_button.pack()
# run the window
window.mainloop()