title: saving the output on text file in python
body: <p>I am trying to print the results of huge matrix calculation but when I print it in text file using this method </p>
  
  <pre><code>rig_stdout = sys.stdout
  f = file('Trimer.txt', 'w')
  sys.stdout = f
  for i,u in enumerate(Trimer_basis):
      print  u,':',i+1, 'times'
  w, v = linalg.eig(EigenMatrix)
  print "The energies are"
  print w
  </code></pre>
  
  <p>it does not print the full results instead I got part of it as the following 
  The energies are</p>
  
  <pre><code>[-6. -4. -2. ...,  0.  0.  0.] 
  </code></pre>
  
  <p>I was wondering if there is better way to print such big data in text file ? </p>