Import From SubFolder

Jorgen Bodde jorgen.maillist at gmail.com
Tue Apr 17 05:44:03 EDT 2007


>From what I know, if you place a __init__.py file in the folder that
will become your subfolder, you can make it a module subfolder.

Like;

d:\src\app\submodule\__init__.py   (can be empty file)

Then in d:\src\app\main.py simply do;

import submodule

# use your new module like

submodule.somefunction()

- Jorgen



More information about the Python-list mailing list