title: Can you pass a variable by reference to a callback method in python?
body: <p>I'm working on a GUI using <code>tkinter</code> in Python 3, and I have an <code>Entry</code> text box named <code>inputFilePathDisplay</code> with the following binding:</p>
  
  <pre><code>inputFilePathDisplay.bind("&lt;Key&gt;", lambda event, filePath = inputFilePath: key(event, filePath))
  </code></pre>
  
  <p>I have the following callback function for when a key is pressed:</p>
  
  <pre><code>#input functions -- see if the user has entered text
  def key(event, filePath):
      filePath = event.widget.get()
  </code></pre>
  
  <p>My goal is to get the input in the <code>Entry</code> box and assign it to <code>inputFilePath</code>. I can see that the <code>filePath</code> variable is changed in the <code>key()</code> function, but the value for <code>inputFilePath</code> is not updated. I'm fairly new to Python, so I'm not as familiar with how it handles passing arguments by reference. What is it I'm missing?</p>
  
  <p>Thank you for your time.</p>