title: Python: Passing values from GUI to other python script
body: <p>I have a python script (we'll say "script.py") that I want to grab values from using a separate GUI python script ("GUI.py"). When I run my GUI.py script, I want to have these text fields in the GUI sent over to script.py after clicking a button in the GUI. I am thinking that my best solution might be to have the GUI.py create another script ("lib.py") that holds all these values and it just writes to it. It then runs the "script.py" script. So all in all the GUI.py will have a function that when called will look something like this:  </p>
  
  <pre><code>def on_button(self):
      username = self.usernameInput.get()
      file = open(“lib.py”,”w”) 
      file.write(“username = ” + username) 
      os.system("script.py")
  </code></pre>
  
  <p>I think this will work, but I am just wondering, does this seem like a practical solution? Let me know what you guys think.</p>