Shrutarshi Basu wrote:
> 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.

It will be the user's config.py.

Look at sys.path to see the order in which directories are searched for 
imports.

Ken
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to