from tkinter import *
r=Tk()
r.title('try')
scrollbary=Scrollbar(r,orient=VERTICAL)
scrollbarx=Scrollbar(r,orient=HORIZONTAL)
text=Text(r,wrap=NONE)
scrollbary.pack(side=RIGHT,fill=Y)
scrollbarx.pack(side=BOTTOM,fill=X)
text.pack(side=LEFT,padx=10,pady=10)
scrollbary.config(command=text.yview)
scrollbarx.config(command=text.xview)
text.config(yscrollcommand=scrollbary.set)
text.config(xscrollcommand=scrollbarx.set)
r.mainloop()
运行是这样的
希望是这样的滚轮