python: import global variable from parent directory
Question: 
    applications/
        app.py
        extensions.py
        controllers/
            __init__.py
            inner.py
    

app.py

    
    
    import inner
    from extensions import aaa
    inner.test()
    

extensions.py

    
    
    import os
    aaa = os.system
    

__init__.py

    
    
    from inner import *
    

inner.py

    
    
    from extensions import aaa
    def test():
        aaa('pwd')
    

My project structure and code is described above, and the program will start
from app.py.  
Why does this work? How is aaa imported in inner.py?  
Why can we directly import from extensions.py which located in parent
directory?  


Answer: You aren't importing from the "parent directory", you're importing from
`applications/`. That `applications/` happens to be the parent directory is a
coincidence.

