title: How to open and edit an existing file in Python?
body: <p>I've been working for a while now on a variety of different programs to practice my Python, the most notable being my choose-your-own-adventure game, which is well over 1000 lines so far.  More recently, I have been trying to edit files from within Python, and I can't seem to figure it out.  For instance, if I set a variable to a user input like so:
  <code>input1 = raw_input("What is your favorite food?")</code> Then, let's say I want to save this text to a .txt file that already exists, like <code>food.txt</code>.  How would I do that?</p>