python记事本之添加行文本编辑和右边滑条滚动功能
import tkinter as my
# 右边滚动下拉条
s1 = Scrollbar(root)
s1.pack(side = RIGHT,fill = Y)
#也可以写成
s1 = my.Scrollbar(root)
s1.pack(side = my.RIGHT,fill = my.Y)
#s2 = my.Scrollbar(root,orient = HORIZONTAL)
#s2.pack(side = my.BOTTOM,fill = my.X)
# 文本编辑
m = Text(root,yscrollcommand=s1.set)
s1.config(command=m.yview)
#s2.config(command = m.xview)
#m.config(xscrollcommand = s2.set)
m.pack(expand = YES,fill = BOTH)