how to import a .py in a parent directory ?

Fredrik Lundh fredrik at pythonware.com
Wed Feb 16 02:34:58 EST 2005


Fouff wrote:

> > I know to import a .py in a subdirectory is   :   .  (dot)

(huh?)

> > but what is the statment for parent directory ?
>
> sys.path.append("..")
> import you_python_file_you_want_to_import.py

make that:

    import you_python_file_you_want_to_import

</F> 






More information about the Python-list mailing list