Re: Organizing code - import question

2007-05-04 Thread Carlos Hanson
On 5/3/07, Brian Blais <[EMAIL PROTECTED]> wrote: > Carlos Hanson wrote: > > It looks like you need __init__.py in MyPackage. Then you can import > > starting with MyPackage. For example, you might use one of the > > following: > > > > import MyPackage > > from MyPackage.Common import * > >

Re: Organizing code - import question

2007-05-03 Thread Gabriel Genellina
En Thu, 03 May 2007 12:41:00 -0300, Brian Blais <[EMAIL PROTECTED]> escribió: > I am trying to organize some of my code, and am having a little trouble > with the import logic. I find I often have something like: > > MyPackage/ > Part1/ # wants to use functions in Common/ > __init__

Re: Organizing code - import question

2007-05-03 Thread Brian Blais
Carlos Hanson wrote: > It looks like you need __init__.py in MyPackage. Then you can import > starting with MyPackage. For example, you might use one of the > following: > > import MyPackage > from MyPackage.Common import * > etc > that means that MyPackage must be in the sys path too?

Re: Organizing code - import question

2007-05-03 Thread Carlos Hanson
On May 3, 8:41 am, Brian Blais <[EMAIL PROTECTED]> wrote: > Hello, > > I am trying to organize some of my code, and am having a little trouble with > the > import logic. I find I often have something like: > > MyPackage/ > Part1/ # wants to use functions in Common/ > __init__.py # does