howto add a sub-directory to the searchpath / namespace ?

stef mientki stef.mientki at
Wed Oct 10 22:41:37 CEST 2007


my program has become a bit large,
and now I want to split the files over several subdirectories.
So in the example shown below, I just moved the files and to 
a deeper subdirectory.


Now I don't want (even can't) change my program,
to change imports from
    from f1 import something
    from subdir1.f1 import something
simply because and are python files dropped by users
and I do not know on forehand what will be dropped.

I looked into the description of,
in the hope I could make and available as if they were in 
the basedirectory,
but i couldn't find a way.

Is there a way to make and available as if they were located 
in the base directory,
without knowing their names (so in general all py-files in the subdir1)  ??

Stef Mientki

More information about the Python-list mailing list