title: How to open another python file from tkinter in a specific condition(like user wins)
body: <p>According to my advisor, she wants me to give a more fancy window when the user wins. I asked whether there is a way to play gif on stack overflow before, and there is a way according to some people. Now I have finished writing the script for the gif which is going to play (actually I referred that from a website because my ability is limited):</p>
  <pre><code>import tkinter as tk
  from PIL import Image, ImageTk
  from itertools import count, cycle
  
  
  class ImageLabel(tk.Label):
      def load(self, im):
          if isinstance(im, str):
              im = Image.open(im)
      frames = []
  
          try:
              for i in count(1):
                  frames.append(ImageTk.PhotoImage(im.copy()))
                  im.seek(i)
          except EOFError:
              pass
      self.frames = cycle(frames)
  
          try:
              self.delay = im.info['duration']
          except:
              self.delay = 100
  
          if len(frames) == 1:
              self.config(image=next(self.frames))
          else:
              self.next_frame()
  
      def unload(self):
          self.config(image=None)
          self.frames = None
  
      def next_frame(self):
          if self.frames:
              self.config(image=next(self.frames))
              self.after(self.delay, self.next_frame)
  root = tk.Tk()
  lbl = ImageLabel(root)
  lbl.pack()
  lbl.load('D:/Personal/Game/Win.gif')
  root.mainloop()  
  </code></pre>
  <p>Now I have seen that a class is defined, so can I add the class in <code>showframe</code> like <code>controller.showframe(ImageLabel)</code>?<br />
  The code for the last question:</p>
  <pre><code>class Q10(tk.Frame):
  def __init__(self, parent, controller):
      tk.Frame.__init__(self, parent)
      label = tk.Label(self, text=&quot;MCQ test!!! Does group or period in the periodic table represent outer shell &quot;
                                  &quot;electrons?&quot;,
                       font=LARGE_FONT)
      label.pack(pady=10, padx=10)
  
      button1 = tk.Button(self, text=&quot;Period&quot;,
                          command=lambda: [self.correspondingBehavior(&quot;Wrong...You can draw it out and see&quot;),
                                           controller.show_frame(Failure), fail7()])
      button1.pack()
  
      button2 = tk.Button(self, text=&quot;Group&quot;,
                          command=lambda: controller.show_frame(Success))  # Can I add the imagelabel class here?
      button2.pack()
  
      button3 = tk.Button(self, text=&quot;Quit&quot;, command=lambda: [controller.show_frame(Credits), give_up()])
      button3.pack()
  
  def correspondingBehavior(self, choice):
      print(choice)
  </code></pre>