importing module as filename

david farning dfarning at localhost.localdomain
Tue Nov 11 03:07:10 EST 2003


Peter Otten wrote:

> 
> How about a symlink to disambiguate the module names,
> e. g. ln -s config.py yumconfig.py, and then
> 
> import config, yumconfig
> 

Thanks, great suggestions. I will talk to the upstream maintainers about
1. changing config to something a little less ambigous ;)
2. having them add the symlink 
3  me adding the symlink (I wouldn't want to muck around their sandbox too
much) 


> Somewhat more ambitious: convert the program directory into a package by
> adding an __init__.py script and then
> 
> import config, yum.config
> 
> Peter
Dave Farning




More information about the Python-list mailing list