title: calling python script that requires an input from within bash for loop
body: <p>My python code is called within a bash script, and also the python script requires an input argument from bash loop. But I wasn't sure the best way to do this. Here's my attempt:</p>
  
  <p>bash code:</p>
  
  <pre><code>cat filelList.txt | while read i;#file1List.txt stores file names
  do
  python script.py $i &gt; $i.txt
  done
  </code></pre>
  
  <p>python bit that i'm not sure of:</p>
  
  <pre><code>file = sys.argv[0] # not sure about this
  in = open(file)
  for line in iter(in): # not sure about this
      do something.......
  </code></pre>
  
  <p>Does anyone know the best way to write these 3 python lines? Thank you</p>