title: File edition after glob function through python
body: <p>I wanted to find every instances of a file under different directories and search for value 0 in each of those files and replace them with 500.</p>
  
  <p>Please find the code below:</p>
  
  <p>!/usr/bin/python</p>
  
  <pre class="lang-py prettyprint-override"><code>import glob 
  import os
  
  
  a = glob.glob('/home/*/hostresolve')
  
  for i in a:
  print i 
  </code></pre>
  
  <p>=================================</p>
  
  <p>Now that I found all instances of hostresolve file under home. I wanted to search for value 0 and replace them with value 500 in each of these files. I know there is find and replace function in python but I wanted to know how can we use it to output that we got through glob.</p>