root = Tk(); root.title("Text with: Scrollbar")
root.config(width=150, height=80)
root.propagate(False)
frame = Frame(root)
frame.rowconfigure(0, weight=1)
frame.columnconfigure(0, weight=1)
frame.pack(fill=BOTH, expand=True)
text = Text(frame,
width=20, height=5, font="courier 12", wrap=NONE)
text.grid(row=0, column=0, sticky=NSEW)
xScrollbar = Scrollbar(frame, orient=HORIZONTAL)
xScrollbar.config(command=text.xview)
xScrollbar.grid(row=1, column=0, sticky=EW)
yScrollbar = Scrollbar(frame, orient=VERTICAL)
yScrollbar.config(command=text.yview)
yScrollbar.grid(row=0, column=1, sticky=NS)
text.config(
xscrollcommand=xScrollbar.set,
yscrollcommand=yScrollbar.set)
root.mainloop()