Import Python file from within executing script
<p>I am attempting to import a python file(called test.py that resides in the parent directory) from within the currently executing python file(I'll call it a.py). All my directories involved have a file in it called init.py(with 2 underscores each side of init)</p>

<p><strong>My Problem:</strong> When I attempt to import the desired file I get the following error</p>

<blockquote>
  <p>Attempted relative import in non-package</p>
</blockquote>

<p>My code inside a.py:</p>

<pre><code>try:
    from .linkIO can_follow # error occurs here
except Exception,e:
     print e
print success
</code></pre>

<p>Note: I know that if I were to create a file called b.py and import a.py(which in itself imports the desired python file) it all works, so whats going wrong?</p>

<p>For eg:</p>

<p>b.py:</p>

<pre><code>import a
print "success 2"
</code></pre>
