Python calling a module
<p>Im trying to call module but some reason its giving me error.
The data.py contains a list of items and in the main.py Im trying to iterate and print over the items.but I get the below error.</p>

<p>Error</p>

<pre><code>Import error: No module named Basics
</code></pre>

<p>Both data.py &amp; main.py are located in c:/python27/basics/</p>

<p>data.py</p>

<pre><code>bob={'name':'bobs mith','age':42,'salary':5000,'job':'software'}
sue={'name':'sue more','age':30,'salary':3000,'job':'hardware'}
people=[bob,sue]
</code></pre>

<p>main.py</p>

<pre><code>from Basics import data

if __name__ == '__main__':
    for key in people:
        print(key, '=&gt;\n  ', people[key])
</code></pre>

<p>If I just give import data, then I get the below error</p>

<p>Name error:name 'people' is not defined.</p>

<p><strong>Update:</strong></p>

<p>New code:</p>

<pre><code>from Basics import data

if __name__ == '__main__':

    for key in data.people:
        print(key, '=&gt;\n  ', data.people[key])
</code></pre>

<p>TypeError:list indices must be integers, not dict</p>
