How to get sequence number of the file in the folder?
<p>I have Windows PC. My script should identify sequency number of the file passed in the command line in the folder, i.e.</p>

<pre><code>myscript.py \\network-drive\files\Long-long.file.name.with.numbers.txt
</code></pre>

<p>Folder content is the following:</p>

<pre><code>\\network-drive\files\
    folder1
    folder2
    file1
    file2
    Long.long.file.name.with.numbers.txt
    file3
    file4
</code></pre>

<p>My script should identify sequence number of the file given in the command line, i.e. should return 5 (folders are also to be counted; assumption is that files are sorted by their names).</p>

<p><strong>Upd</strong>. I've stopped with the following:</p>

<pre><code>import sys
import os.path

if sys.argv[1]: # regardless of this verification, exception happens if argument is not passed
    head, tail = os.path.split(sys.argv[1])
    print head
    print os.listdir(head)
</code></pre>

<p>The list returned by <code>listdir</code> doesn't allow me to identify what is folder and what is file. So, I can not sort them properly.</p>
