title: Curling in Python and Outputting into Individual Text Files
body: <p>How do you read multiple lines containing say 3 URLs from a .txt file, "curl" them to extract the HTML, and output them all to their own individual files in python?
  I've tried-</p>
  
  <pre><code>    import commands
      import os
      import json
  
      # RAW DATA
      input = open('uri.txt', 'r')
      t_1 = open('command', 'w')
      counter_1 = 0
  
      for line in input:
            counter_1 += 1
      if counter_1 &lt; 3:
            filename = str(counter_1)
            print str(line)
      filename= str(count)
      command ='curl ' + '"' + str(line).rstrip('\n') + '"'+ '&gt; ./rawData/' + filename
  
      output_1 = commands.getoutput(command)
      input.close()
  </code></pre>
  
  <p>When I run my code in PyCharm, it creates a single blank file in my directory called "filename.txt"</p>