[Tutor] importing modules

Michael Barrett mike@daboyz.org
Mon Jul 21 17:49:02 2003


Assuming your project is in directory /path/to/project and the module is called 'mymodule.py' then you can do the following in your script:

import sys
sys.path.append('/path/to/project')

import mymodule

=====

Hope that helps.

On Mon, Jul 21, 2003 at 02:00:15PM -0300, Luiz Siqueira Neto wrote:
> How can I import modules inside of a directory in a root of my project?
> 
> in java I use import dir.package.*
> 
> _______________________________________________
> Tutor maillist  -  Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor

-- 
     ________________________________________________________________________
                Mike Barrett | "We have veggie bacon, why don't we have
             mike@daboyz.org |  meat fruit?"
              www.daboyz.org |    -- My co-worker, Ben
     ------------------------+-----------------------------------------------