Python import file with dependencies in the same folder
<p>I have a file ref.py that depends on a text file <code>ex.txt</code>, that is in the same directory <code>\home\ref_dir</code> . So it works normally when I run the file <code>ref.py</code>, but if I try to import <code>ref.py</code> to another file work.py in a different directory <code>\home\work_dir</code> , I do the following</p>

<pre><code>import sys
sys.path.append('\home\ref_dir')
import ref
</code></pre>

<p>But then I get an error, that the program cannot find <code>ex.txt</code></p>

<p>How can I solve this issue without using absolute paths. Any ideas?</p>
