import module from another path cause IOERROR:NO such file or directory
<p>this is a visual representation of my directory :</p>

<p><img src="http://i.stack.imgur.com/tHtFX.png" alt="enter image description here"></p>

<p>here is the code snippet from test1.py </p>

<pre><code>....
def foo():
    f=read("./test1.dat","r")
....
</code></pre>

<p>here is the code of test2.py </p>

<pre><code>import imp

TEST1 = imp.load_source('test1', '../test1.py')


def test2():
    TEST1.foo()
</code></pre>

<p>running test2.py</p>

<pre><code>cd subdir
python test2.py
</code></pre>

<p>got IOERROR: No Such file or directory : "./test1.dat"</p>

<p>my question is :</p>

<p>if I don't change the structure of directory, for example move test2.py to its parent directory, is it possible to make module test1 find the correct file when calling it in module test2?</p>
