On Aug 11, 5:12 pm, guthrie <guth...@mum.edu> wrote:
> This works fine, but in the sub-modules the sys.path appropriately
> returns the same as from the parent, I want them to know their own
> file names. How?? I can pass it to them, but wondered if there is a
> more self-sufficient way for a module to know from where it was
> invoked.

Instead of sys.path, you may be interested in the __file__ attribute
will give you a module's filename:

http://docs.python.org/reference/simple_stmts.html#index-1031

You could also be more explicit in matching *.py files in your
subdirectory by using glob:

http://docs.python.org/library/glob.html
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to