title: From a .py file converted to an .exe (using py2exe), how do you import data from a written file?
body: <p>My program saves data to an external .py file for use later on. This works fine normally, however once converted to an executable, it saves a file externally, but only draws from the internal data.</p>
  
  <p>This is what the code looks like:</p>
  
  <pre><code>def save_game():
      with open("save.py") as _save:
          _save.write("""variables to be used later""")
          _save.close()
  
  def load_game():
      import save
      reload(save)
      x = save.x
  </code></pre>
  
  <p>In the .py, it creates save.py and writes all the variables. When it loads, all of the variables are imported exactly as written.</p>
  
  <p>After the .exe was created, it creates save.py with all the variables, but it only uses the iteration of save.py that existed when the .exe was created.</p>
  
  <p>Is there any way to achieve similar functionality after converting my app to an executable?</p>