[Tutor] Should config file parser be in module's __init__.py

Shrutarshi Basu technorapture at gmail.com
Wed Mar 19 22:30:23 CET 2008


Ok, I'm starting to understand how things work. Just one last
question: suppose my package has a config.py (which contains a config
dict) which another module in the package imports by "import config".
If the user of my package has a config.py in the directory from where
they run their program (which uses my package), then which config.py
will be used? The user's or the packages? The python tutorial section
on modules leads me to believe it will be the users, since the current
directory is searched first, but I'm not sure because it is my package
which does the import, not the users program.
Thanks again,
Basu


More information about the Tutor mailing list