title: How to display string variables in Tkinter?
body: <p>I am trying to create a GUI program in python to generate random Lottery numbers. I want to have a menu bar for choosing Powerball or MegaMillion. And after choosing it, there will be buttons to let user select how many tickets to show. But I cannot make the method work. I want to show different lines of number lists when I click the button, but it does show anything. I'm not finished yet since it doesn't work. I am new to Python and programming, please help! Thank you !</p>
  
  <pre><code>from tkinter import *
  import random
  
  class lotteryNum:
      def __init__(self):
          window=Tk()
          window.title("Lottery Number Generator")
  
          menubar = Menu(window)
          window.config(menu=menubar)
  
          self.pbLst = [x for x in range(1,70)]
          self.pbLst2=[x for x in range(1,27)]
          self.mmLst = [x for x in range(1,76)]
          self.mmLst2=[x for x in range(1,16)]
          self.usingLst=["*"]*6
  
  
  
          #Type Menu
          typeMenu = Menu(menubar, tearoff = 0)
          menubar.add_cascade(label = "Which Lottery", menu = typeMenu)
          typeMenu.add_command(label="Powerball", command= self.powerBall)
          typeMenu.add_command(label="Mega Milion", command= self.megaMillion)
  
  
          #Exit menu
          exitmenu = Menu(menubar, tearoff = 0)
          menubar.add_cascade(label = "Exit", menu = exitmenu)
          exitmenu.add_command(label = "Quit", command = window.quit)
  
          #Welcome label
          Label(window, text="Welcome to Lottery Generator!").pack()
  
          frame=Frame(window)
          frame.pack()
  
          #Text Label
          self.showResults = StringVar()
          Label(frame, text=self.showResults).pack()
  
  
  
  
          Button(window, text="$2", command=self.runLottery()).pack(side=LEFT)
  
          window.mainloop()
  
  
      def powerBall(self):
          # random.shuffle(self.pbLst)
          # random.shuffle(self.pbLst2)
          self.usingLst=self.pbLst
          self.usingLst2=self.pbLst2
  
      def megaMillion(self):
          # random.shuffle(self.mmLst)
          # random.shuffle(self.mmLst2)
          self.usingLst=self.mmLst
          self.usingLst2=self.mmLst2
  
      def runLottery(self):
          random.shuffle(self.usingLst)
          random.shuffle(self.usingLst2)
          self.usingLst[:5].extend(self.usingLst2[0])
          self.showResults.set(self.usingLst)
  
  
  
  
  
  lotteryNum()
  </code></pre>