title: how to execute a command for all .dat files in a directory
body: <p>I want to be able to execute these few simple commands for all .dat files within a directory. So it will print out all of the maximum values from each file, i just cant figure out how to do it. </p>
  
  <pre><code>dr='/home/data/'
  image='*.dat'
  b=np.genfromtxt(dr+image).T[1] #luminsity
  
  q=getmax(b)
  print 'max b=', q
  </code></pre>