title: Refering to Files and Functions from within a Python package.
body: <p>Let us have a look at the Directory structure of my Python Package</p>
  
  <pre><code>packman
   weights.py
    functions:
     weigh()
     force()
   relatives.py
    functions:
     roll()
     torque()
   __init__.py
   data
    work.txt
    rastor.txt
  </code></pre>
  
  <p>Now I have two questions. </p>
  
  <p>Firstly suppose I want to access work.txt, from the function weigh() inside weights.py how would I address it? 
  I initially tried with this</p>
  
  <pre><code>f = open("data/work.txt")
  </code></pre>
  
  <p>While this method does succesfully work when the code is run inside main. However it fails to find the file when it is used as a package and it raises the issue </p>
  
  <blockquote>
    <p>FileNotFoundError: [Errno 2] No such file or directory: 'data/work.txt'</p>
  </blockquote>
  
  <p>How should I write the address of work.txt to make it more universal? </p>
  
  <p>My other question is when I want to call the function weigh() of weights.py from the function roll() inside relatives.py, how would I do it? </p>