title: Tkinter changing image on a canvas
body: <p>So I have written some code that displays a random question on a certain topic for maths students. The module definition presents the initial image on the topic chosen. Then the next question and mark scheme definitions are used under the respective buttons. The next question one works fine however because the mark scheme definition is linked the the module definition the question does not update. Resulting in only the mark scheme for the very first question showing. How can i get it to update with the next question button?</p>
  
  <pre><code>def module(mod):
      def mark_scheme():
          questions.delete('all')
          scheme=random_question.replace('.GIF', 'MS.GIF')
          answer=ImageTk.PhotoImage(file=scheme)
          lab1.configure(image=answer)
          lab1.image=answer
          lab1.pack(fill=BOTH, expand=1)
          return
  
      def next_question():
  
          questions.delete('all')
          random_question=random.choice(mod)
          question=ImageTk.PhotoImage(file=random_question)
          lab1.configure(image=question)
          lab1.image=question
          lab1.pack(fill=BOTH, expand=1)
          return
  
      questions=Canvas(root)
      questions.pack(fill=BOTH, expand=1)
      lab1=Label(questions)
      random_question=random.choice(mod)                            
      question=ImageTk.PhotoImage(file=random_question) 
      lab1.configure(image=question)
      lab1.image=question
      lab1.pack(fill=BOTH, expand=1)
      button1=Button(root, text='Next Question', command=next_question).pack()
      button2=Button(root, text='Mark Scheme', command=mark_scheme).pack()
      return
  </code></pre>