Tkinter scroll bar not scrolling
<p>I am trying to create a gui with two canvas and a scrolling bar going through both at the same time, as a test for another project. I have created the root, the two canvas and pinned some labels to each using the grid method, as well as created the scroll bar.</p>

<p>However, when I run the program, the scroll bar moves fines, but the content of the window doesn't change at all, as if the bar wasn't working. I have tried a few solutions by googling my problem, but so far I haven't been able to solve it.</p>

<p>The relevant code is</p>

<pre><code>from tkinter import *
root = Tk()
‪#‎scroll‬
scrollbar = Scrollbar(root)
scrollbar.pack(side=RIGHT, fill=Y)
firstCanvas = Canvas(root, width=200, height=100)
firstCanvas.pack(side="left", fill="both", expand=True)
secondCanvas = Canvas(root, width=20000, height=10000,scrollregion=(0,0,0,5000),yscrollcommand=scrollbar.set)
secondCanvas.pack(side="left", fill="both", expand=True)
secondCanvas.create_rectangle((200,300,300,6000))
widget = Label(firstCanvas, text='Spam')
widget.pack()

# Lots of widgets so they reach beyond the screen, all in the following format

widgetOne=Label(firstCanvas, text="this is a test")
widgetOne.pack()
widgetTwo=Entry(firstCanvas)
widgetTwo.pack()
widgetThree=Label(secondCanvas, text='Spam')
widgetFour=Entry(secondCanvas)
widgetFour.pack()   

scrollbar.config(command=secondCanvas.yview)
mainloop()
</code></pre>