Re: Newbie packages Q

2007-10-07 Thread Alex Martelli
MarkyMarc <[EMAIL PROTECTED]> wrote: ... > > As long as '/python' comes in the list before any other directory that > > might interfere (by dint of having a Test.py or Test/__init__.py), and > > in particular in the non-pathological case where there are no such > > possible interferences, my ass

Re: Newbie packages Q

2007-10-07 Thread MarkyMarc
On Oct 7, 10:31 pm, [EMAIL PROTECTED] (Alex Martelli) wrote: > MarkyMarc <[EMAIL PROTECTED]> wrote: > >... > > > > > > > And sys.path is /python/Test/bpack > > > > sys.path must be a LIST. Are you saying you set yours to NOT be a list, > > > but, e.g., a STRING?! (It's hard to tell, as you s

Re: Newbie packages Q

2007-10-07 Thread Alex Martelli
MarkyMarc <[EMAIL PROTECTED]> wrote: ... > > > > > And sys.path is /python/Test/bpack > > > > sys.path must be a LIST. Are you saying you set yours to NOT be a list, > > but, e.g., a STRING?! (It's hard to tell, as you show no quotes there). ... > > > I also tried to put /python/ and /pyth

Re: Newbie packages Q

2007-10-07 Thread MarkyMarc
On Oct 7, 10:05 pm, [EMAIL PROTECTED] (Alex Martelli) wrote: > MarkyMarc <[EMAIL PROTECTED]> wrote: > >... > > > > > And sys.path is /python/Test/bpack > > sys.path must be a LIST. Are you saying you set yours to NOT be a list, > but, e.g., a STRING?! (It's hard to tell, as you show no quote

Re: Newbie packages Q

2007-10-07 Thread Alex Martelli
MarkyMarc <[EMAIL PROTECTED]> wrote: ... > > > And sys.path is /python/Test/bpack sys.path must be a LIST. Are you saying you set yours to NOT be a list, but, e.g., a STRING?! (It's hard to tell, as you show no quotes there). > > The 'Test' package is *not* in your sys.path. > > I can say

Re: Newbie packages Q

2007-10-07 Thread MarkyMarc
On Oct 7, 8:00 pm, Bruno Desthuilliers wrote: > > > And sys.path is /python/Test/bpack > > And you do wonder why you can't import ? Please reread with attention > the first and third points listed above (following the 'But anyway'). > The 'Test' package is *not* in your sys.path. I can say yes

Re: Newbie packages Q

2007-10-07 Thread Bruno Desthuilliers
MarkyMarc a écrit : > On Oct 7, 6:04 pm, Bruno Desthuilliers > But how do I get this to work? >> You failed to specify how your files are organized, and what is "not >> working". >> >> But anyway, if >> - atest.py is in /Test/apack, >> - both Test and apack have a __init__.py >> - is in the sys.pa

Re: Newbie packages Q

2007-10-07 Thread MarkyMarc
On Oct 7, 6:04 pm, Bruno Desthuilliers wrote: > MarkyMarc a écrit : > (snip) > > > It was simply to make a point. But then lets say the to files looks > > like this: > > > *** > > atest.py: > > > def printA(): > > print "This is Atest from Apack" > > **

Re: Newbie packages Q

2007-10-07 Thread Bruno Desthuilliers
MarkyMarc a écrit : (snip) > It was simply to make a point. But then lets say the to files looks > like this: > > *** > atest.py: > > def printA(): > print "This is Atest from Apack" > *** > btest.py: > from Test.apack import atest

Re: Newbie packages Q

2007-10-07 Thread MarkyMarc
On Oct 7, 5:49 pm, Wildemar Wildenburger <[EMAIL PROTECTED]> wrote: > MarkyMarc wrote: > > *** > > atest.py: > > > def printA(): > > print "This is Atest from Apack" > > *** > > btest.py: > > from Test.apack import atest > > > def pri

Re: Newbie packages Q

2007-10-07 Thread Wildemar Wildenburger
MarkyMarc wrote: > *** > atest.py: > > def printA(): > print "This is Atest from Apack" > *** > btest.py: > from Test.apack import atest > > def printB(): > print "This is Btest from Bpack" > > def printatest(): > p

Re: Newbie packages Q

2007-10-07 Thread MarkyMarc
On Oct 7, 5:22 pm, Wildemar Wildenburger <[EMAIL PROTECTED]> wrote: > MarkyMarc wrote: > > On Oct 7, 4:24 pm, Bruno Desthuilliers > [EMAIL PROTECTED]> wrote: > >> MarkyMarc a écrit : > >> import is a statement. It's executed, like any other top-level code, > >> when the module is imported (or the

Re: Newbie packages Q

2007-10-07 Thread Wildemar Wildenburger
MarkyMarc wrote: > On Oct 7, 4:24 pm, Bruno Desthuilliers [EMAIL PROTECTED]> wrote: >> MarkyMarc a écrit : >> import is a statement. It's executed, like any other top-level code, >> when the module is imported (or the script loaded into the interpreter >> if it's called directly). So if A.py impor

Re: Newbie packages Q

2007-10-07 Thread MarkyMarc
On Oct 7, 4:24 pm, Bruno Desthuilliers wrote: > MarkyMarc a écrit : > (snip) > > > And the atest and btest, shouldn't they be able to import each > > other?? > > import is a statement. It's executed, like any other top-level code, > when the module is imported (or the script loaded into the interp

Re: Newbie packages Q

2007-10-07 Thread Bruno Desthuilliers
MarkyMarc a écrit : (snip) > And the atest and btest, shouldn't they be able to import each > other?? import is a statement. It's executed, like any other top-level code, when the module is imported (or the script loaded into the interpreter if it's called directly). So if A.py imports B.py and

Re: Newbie packages Q

2007-10-07 Thread MarkyMarc
On Oct 7, 2:16 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > Would it hep to observe that the atest and btest submodules attemot to > import each other? > > There is no reason I can see for apack and bpack to be subpackages. Why > not just rename atest.py as apack.py at the same level as the Test >

Re: Newbie packages Q

2007-10-07 Thread Steve Holden
MarkyMarc wrote: > Hi All, > > I do not understand the packages system in python. I have read this > http://docs.python.org/tut/node8.html a 100 times and I can not get it > to work. > > I make a test app like this: > *** > Test/ > __init__.py (a empty file) >

Newbie packages Q

2007-10-07 Thread MarkyMarc
Hi All, I do not understand the packages system in python. I have read this http://docs.python.org/tut/node8.html a 100 times and I can not get it to work. I make a test app like this: *** Test/ __init__.py (a empty file) apack/ __init__.py (