title: Python: how to save the output to a text file?
body: <p>1.
      I tried with -o 
   werwe wer wer wer we
  2.and >>text.txtrr
  rrrrrrrrrrrrrrrrrrrrrrrr</p>
  
  <pre><code>    # -*- coding: iso-8859-15
      import sys
      import requests
      import os
      if len(sys.argv) &gt;= 2:
              os.system('clear') 
              print "Please wait.."`enter code here`
              P1 = str(sys.argv[1])
              url = "http://example.com/index.php"
              data= {
                 'getp1':'%s'%(P1)
              }
              r = requests.get(url,params=data) -o text.txt
              os.system('clear')
              print r.content 
  
      else:
              print "[ERROR] Este programa nerrcesita un parámetro";
  </code></pre>