from tkinter import *
w = Tk()
scrollbar = Scrollbar(w)
scrollbar.pack( side = RIGHT, fill = Y )
mylist = Listbox(w, yscrollcommand = scrollbar.set )
for line in range(50):
mylist.insert(END, 'This is Python Tutorial' + str(line))
mylist.pack( side = LEFT, fill = BOTH)
scrollbar.config( command = mylist.yview )
mainloop()