Scanning duplicate file names
<p>Imagine several folders such as</p>

<pre><code>d:\myfolder\abc
d:\myfolder\ard 
d:\myfolder\kjes
...
</code></pre>

<p>And in each folder, there are files such as </p>

<pre><code>0023.txt, 0025.txt, 9932.txt in d:\myfolder\abc
2763.txt, 1872.txt, 0023.txt, 7623.txt in d:\myfolder\ard
2763.txt, 2873.txt, 0023.txt in d:\myfolder\kjes
</code></pre>

<p>So, there are three <code>0023.txt</code> files, and two <code>2763.txt</code> files.</p>

<p>I want to create a file (say, <code>d:\myfolder\dup.txt</code>) which contains the following information:</p>

<pre><code>0023 3
0025 1
9932 1
2763 2
1872 1
7623 1
2873 1
</code></pre>

<p>How can I implement that in Python? Thanks.</p>
