Python access to Parent Directory
Question: I have a file in the directory

    
    
    app
       a
         Ulil.py
       b
         main.py
    

I want to import Ulil.py (at app\a) into main.py (at app\b).

How do i go about doing this. I need to move the file around as well so I
don't want to put the entire path. I just to be in app\b and access only
app\a. Folder name stays the same.


Answer: First, create an empty file called `__init__.py` in **a**

Second, in **main.py** in **b** import it using

    
    
    import sys 
    sys.path.insert( 0, '../' )
    from a.Util import *
    

