shawn bright wrote: > hello there, > > if i have a module that is in the same directory as the file that > imports it, > but that module has the same name as a module in my python path, which one > gets imported ?
The local one. sys.path has the list of directories that are searched for imports, in the order they are searched. The local directory is first. You can look at the __file__ attribute of a module to see where it comes from, e.g. import mymodule print mymodule.__file__ Kent > > i ask because i want to do some work on the module, but dont want to > mess with my stable > one in site-packages. > so i want to import it from the local directory only. > > thanks > > shawn > > > ------------------------------------------------------------------------ > > _______________________________________________ > Tutor maillist - Tutor@python.org > http://mail.python.org/mailman/listinfo/tutor _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor