title: NameError: name 'split' is not defined
body: <p>I am running the python script as follows,the second arugment is a comma(",") seperated input..am trying to split this arugment based on "," and keep appending the 
  output of each filter_log  for each string to output.txt
  1.)am getting the below error while doing so?
  2.)how to keep appending to output.txt  for each search string passed in second argument?</p>
  
  <p>ERROR:-</p>
  
  <pre><code>string = split(",",sys.argv[2])
  NameError: name 'split' is not defined
  </code></pre>
  
  <p>USAGE:-</p>
  
  <pre><code>python test.py input.log loc\modem,loc\data
  </code></pre>
  
  <p>CODE:-</p>
  
  <pre><code>import sys
  import string
  
  def filter_log(input_file, output_file, strs):
      with open(input_file, "r") as input, open(output_file, "w") as output:
          output.writelines(filter(lambda x: all([s in x for s in strs]), input.readlines()))
  
  # here is just searched for "Warning", add other stuff
  #filter_log("input.txt", "output.txt", ["Warning"])
  
  print sys.argv[1]
  print sys.argv[2]
  for arg in sys.argv[2]:
      string = split(",",sys.argv[2])
      filter_log(sys.argv[1], "output.txt", ["Warning",string])
  </code></pre>