title: How can I save data to/load data from a text file as variables in Python?
body: <p>I'm using Python 2.7.8 and I'm trying to code a simple text-based game. In order for it to work well, I'd like to be able to save certain variables into a text file <em>and then load them back in as variables the next time I run the program.</em> Ideally, I'd like to store each variable on its own line but I'm not quite sure how to make that happen. EDIT: Here's my relevant code:</p>
  
  <p><a href="https://gist.github.com/anonymous/3a14fcd68b0045b2c0c0" rel="nofollow">https://gist.github.com/anonymous/3a14fcd68b0045b2c0c0</a></p>
  
  <p>For some reason, the code crashes at launch.
  Apologies because I'm a little new to Python. Anyway, is there a better way to write this information to a file? In addition, what could I use to read a variable from that file and store it as a variable in the game?</p>
  
  <p>EDIT: I have now learned something incredibly useful which allows me to debug. Here is what the shell says when the code is run:</p>
  
  <p><a href="https://gist.github.com/anonymous/bfc085d8d1d0b7969574" rel="nofollow">https://gist.github.com/anonymous/bfc085d8d1d0b7969574</a></p>
  
  <p>Thanks so much.</p>