Python package usage
Question: I have "Dir A" which contains "Dir B" and "Dir C".

"Dir B" has "file.py" and "Dir C" has "library.py". I want to be able to
import "library.py" into "file.py". and other possible files. I am very
confused how to do it. Can someone help please?

I tried putting "**init**.py" inside different directories but it does not
seem to help when i do "import library" in "file.py".

Thanks!


Answer: First you need to name your init files as **init**.py to turn them into
packages:

    
    
    dir_A
       __init__.py
       dir_B 
          __init__.py
          file.py
       dir_C
          __init__.py
          library.py  
    

Now from file.py you should be able to use:

    
    
    import A.C.library
    

