title: Write multiple values into text file in Python?
body: <p>I have created a set of 6 random integers and I wish to write 500 of them into a text file so it looks like this inside the text file:</p>
  
  <p>x, x, xx, x, xx, x \n
  x, x, x, xx, x, x    ....etc</p>
  
  <p>(where x is an integer)</p>
  
  <pre><code>from random import shuffle, randint
  
  def rn():
      return randint(1,49);
  
  print "Random numbers are: " , rn(), rn(), rn(), rn(), rn(), rn()
  </code></pre>
  
  <p>There must be an easier way than pasting the last line 500 times?</p>
  
  <p>EDIT: Why all the down votes? I'm sorry if this is a basic question for you guys but for someone learning python it's not.</p>