python import the same file name programatically from different folders
<p>I have the following structure </p>

<pre><code>sites 
  - SiteA
    - Settings.py
  - SiteA
    - Settings.py
  - SiteA
    - Settings.py
</code></pre>

<p>all the settings.py file has a variable </p>

<p>DOMAIN_KEY = ''</p>

<p>Is there a way to programmically import this structure and look through this variable in all the setting files and print it?</p>

<p><strong>EDIT (Updated code):</strong></p>

<pre><code>with cd(os.path.join(APPLICATION_DIR, 'config', 'sites')):
    output = run ("ls -l | grep \"^d\"|awk {'print $8'}") # run will execute and return list of folders
    for file in output.split():
        __module = __import__('%s' % file)
        print __module
        print __module.TIME_ZONE
        print __module.SITE_ID
</code></pre>

<p>The import is not working properly, am not sure how I can import the setting files without knowing the folder name.</p>
