Acess modules from different directory
Question: I have the following file structure

    
    
    python/
        A/
            a.py
            b.py
        B/
            c.py
    

So there are two folders A and B under the folder python and I want to import
modules from a.py and b.py - import them in c.py ( B folder)

I wrote an `__init__.py` with `__all__=['modulename']` and placed it in folder
`B`. Now in my `c.py` I import the modules using `import` statement. This
however does not seem to work. Any thoughts on how I can achieve the import of
the modules in above case?


Answer:   1. Add the full path for `python` to `PYTHONPATH` in your environment.
  2. Add **empty** `__init__.py` file inside `A`.

Then in `c.py`:

    
    
    from A.a import something
    from A.b import something
    
    # or
    
    import A
    A.a.something
    A.b.something
    

