paths in modules

Brandon Mintern mintern at cse.ohio-state.edu
Thu Feb 22 11:43:30 EST 2007


On Thu, 22 Feb 2007 10:30:59 -0600, Larry Bates wrote:
> Normally this would be:
> 
> f = os.popen('./wrapper_dir/utility_dir/some_external_utility')
> 
> -Larry

Yes, but the problem with that solution is, let's say that I further
abstract the whole thing and I add a directory outside of my toplevel_dir,
which has the syntax:

from toplevel_dir.wrapper_dir import some_wrapper

some_wrapper.use_external_utility()


Now, once again, the module is broken.  This is what I was trying to
avoid.  At any rate, Paul's solution was exactly what I was looking for.



More information about the Python-list mailing list