Skip to content

Commit 2fc0243

Browse files
author
Mofan Zhou
committed
create tk6
1 parent af39bdf commit 2fc0243

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

tkinterTUT/tk6_scale.py

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# View more python learning tutorial on my Youtube and Youku channel!!!
2+
3+
# Youtube video tutorial: https://www.youtube.com/channel/UCdyjiB5H8Pu7aDTNVXTTpcg
4+
# Youku video tutorial: http://i.youku.com/pythontutorial
5+
6+
import tkinter as tk
7+
8+
window = tk.Tk()
9+
window.title('my window')
10+
window.geometry('200x200')
11+
12+
l = tk.Label(window, bg='yellow', width=20, text='empty')
13+
l.pack()
14+
15+
def print_selection(v):
16+
l.config(text='you have selected ' + v)
17+
18+
s = tk.Scale(window, label='try me', from_=5, to=11, orient=tk.HORIZONTAL,
19+
length=200, showvalue=0, tickinterval=2, resolution=0.01, command=print_selection)
20+
s.pack()
21+
22+
window.mainloop()

0 commit comments

Comments
 (0)