Can someone explain these few lines of python code file name __init__.py
<pre><code>import os, unittest

# figure all the modules available
dir = os.path.split(__file__)[0]
</code></pre>

<p>This prints the current directory, as <strong>file</strong> points points to the current file name</p>

<pre><code>mods = {}
</code></pre>

<p>dont know what this does, but i can guess this creates a list ? or an array ?</p>

<pre><code>l = []
</code></pre>

<p>I guess this also creates an array and assigns it l</p>

<pre><code>__all__ = []
</code></pre>

<p>Dont know if <code>__all__</code> has some special significance, but it does look like an array</p>

<pre><code>for file in os.listdir(dir):
    if not file.endswith('.py') or file == '__init__.py':
        continue
    name = file[5:-3]
</code></pre>

<p>5:-3 , what does that mean ?</p>

<pre><code>mods[name] = __import__(file[:-3], globals(), locals(), [])
</code></pre>

<p>what does mods means ?</p>

<pre><code>__all__.append(name)
l.append(mods[name].suite())

def suite():
    return unittest.TestSuite(l)
</code></pre>
