title: Pickle vs output to a file in python
body: <p>I have a program that outputs some lists that I want to store to work with later. For example, suppose it outputs a list of student names and another list of their midterm scores. I can store this output in the following two ways:</p>
  
  <p>Standard File Output way: </p>
  
  <pre><code>newFile = open('trialWrite1.py','w')
  newFile.write(str(firstNames))
  newFile.write(str(midterm1Scores))
  newFile.close()
  </code></pre>
  
  <p>The pickle way:</p>
  
  <pre><code>newFile = open('trialWrite2.txt','w')
  cPickle.dump(firstNames, newFile)
  cPickle.dump(midterm1Scores, newFile)
  newFile.close()
  </code></pre>
  
  <p>Which technique is better or preferred? Is there an advantage of using one over the other?</p>
  
  <p>Thanks</p>