Correctness: sys.path.append("..")

Mark McEahern marklists at
Tue Jan 8 23:20:13 CET 2002

Jeremy Bowers
> I've taken to sticking this on top of my files in the subdirectories:
> import sys
> if ".." not in sys.path:
> 	sys.path.append("..")

Suppose you have the following structure:


and you have a module in myproj that needs to use modules in biz,
presentation, and data:

	from import customer
	from myproj.presentation import layout
	from import tabular

That to me seems preferable to mucking with sys.path.


// mark

More information about the Python-list mailing list