title: Python how do I add user entry to a new value on a list?
body: <p>I have a simple Tkinter entry.</p>
  
  <p>When a user inputs an entry and presses the button on the GUI, I want it to add the user entry to a list named <code>self.players</code>.</p>
  
  <p>This works to an extent. The entry is added to the list but when I type in a second entry and press the button it replaces the first entry on the list instead of adding it onto the list as a second entry like I want.</p>
  
  <p>How would I make it so the entry is added to a new value each time.
  Thanks</p>
  
  <p>Here's my code:</p>
  
  <pre><code>import tkinter
  from tkinter import ttk
  
  class Application(object):
  
      def __init__(self):
          self.root = tkinter.Tk()
  
          self.welcomeLabel = tkinter.Label(text = "Welcome to Darts!")
          self.welcomeLabel.grid(row=1, column=0)
  
          self.playerLabel = tkinter.Label(text = ("Type in Player names!"))
          self.playerLabel.grid(row=2, column=0)
  
          self.playerEntry = tkinter.Entry()
          self.playerEntry.grid(row=3, column=0)
  
          self.playGameButton = tkinter.Button(text = "Play", command = self.game_button)
          self.playGameButton.grid(row=4, column=0)
  
  
      def game_button(self):
          self.players = []
  
          playerData = self.playerEntry.get()
  
          self.players = (playerData)
  
          print (self.players)
  
  myApp = Application()
  myApp.root.mainloop()
  </code></pre>