title: How to export data (which is as result of Python program) from command line?
body: <p>I am working on a Python program, and I have results on the command line.</p>
  
  <p>Now I need to do analysis on the results, so I need all results as exported in any format like either SQL, or Excel or CSV format.</p>
  
  <p>Can some tell me how can i do that ?</p>
  
  <pre><code>import csv
  x1=1 x2=2
  while True:
      show = [ dict(x1=x1+1 , x2=x2+2)]
      print('Received', show )
      with open('large1.csv','w') as f1:
          writer=csv.writer(f1, delimiter=' ',lineterminator='\n\n',)
          writer.writerow(show)
      x1=x1+1
      x2=x2+1 
  </code></pre>
  
  <p>Here this is infinite loop and I want to have a csv file containing 2 column of x1 and x2. and with regularly updated all values of x1 and x2 row wise (1 row for 1 iteration) </p>
  
  <p>But by this code I'm getting a csv file which is named as 'large1.csv' and containing only one row (last updated values of x1 and x2).</p>
  
  <p>So how can I get my all values of x1 and x2 as row was in python.</p>