title: Python function that similar to bash find command
body: <p>I have a dir structure like the following:</p>
  
  <pre><code>[me@mypc]$ tree .
  .
  ├── set01
  │   ├── 01
  │   │   ├── p1-001a.png
  │   │   ├── p1-001b.png
  │   │   ├── p1-001c.png
  │   │   ├── p1-001d.png
  │   │   └── p1-001e.png
  │   ├── 02
  │   │   ├── p2-001a.png
  │   │   ├── p2-001b.png
  │   │   ├── p2-001c.png
  │   │   ├── p2-001d.png
  │   │   └── p2-001e.png
  </code></pre>
  
  <p>I would like to write a python script to rename all *a.png to 01.png, *b.png to 02.png, and so on. Frist I guess I have to use something similar to <code>find . -name '*.png'</code>, and the most similar thing I found in python was <code>os.walk</code>. However, in <code>os.walk</code> I have to check every file, if it's png, then I'll concatenate it with it's root, somehow not that elegant. I was wondering if there is a better way to do this? Thanks in advance.</p>