Re: Basic importing question

2008-08-20 Thread Christian Heimes
Bruno Desthuilliers wrote: As the name imply, built-in modules are built in the interpreter - IOW, they are part of the interpreter *exposed* as modules[1]. Unless you have a taste for gory implementation details, just don't worry about this. Other "ordinary" modules need of course to be execu

Re: Basic importing question

2008-08-20 Thread Scott David Daniels
Hussein B wrote: On Aug 20, 6:39 am, Bruno Desthuilliers wrote: Hussein B a écrit : One more question: If I have this structure: orig/com/domain/project/Klass1.py Klass2.py __init__.py Why com, domain, project should have __init__.py also? Yes,

Re: Basic importing question

2008-08-20 Thread Bruno Desthuilliers
Hussein B a écrit : (snip) Thank you both for your kind help and patience :) Built-in modules are compiled For which definition of "compiled" ? but even if they are so, when importing them (sys for example), Python will run their code in order to create bindings and objects, right? As the n

Re: Basic importing question

2008-08-20 Thread Hussein B
On Aug 20, 6:39 am, Bruno Desthuilliers wrote: > Hussein B a écrit : > (snip) > > > One more question: > > If I have this structure: > > orig/com/domain/project/Klass1.py > > Klass2.py > > __init__.py > > > Why com, domain, project should have __init

Re: Basic importing question

2008-08-20 Thread Christian Heimes
Hussein B wrote: Thank you both for your kind help and patience :) Built-in modules are compiled but even if they are so, when importing them (sys for example), Python will run their code in order to create bindings and objects, right? I'm learning Python and I want to learn it well, so that I'm

Re: Basic importing question

2008-08-20 Thread Bruno Desthuilliers
Hussein B a écrit : (snip) One more question: If I have this structure: orig/com/domain/project/Klass1.py Klass2.py __init__.py Why com, domain, project should have __init__.py also? Yes, why should they ? Unless you want to mimic Java's package

Re: Basic importing question

2008-08-20 Thread Hussein B
On Aug 20, 5:43 am, John Machin <[EMAIL PROTECTED]> wrote: > On Aug 20, 8:08 pm, Hussein B <[EMAIL PROTECTED]> wrote: > > > Hey, > > Suppose I have a Python application consists of many modules (lets say > > it is a Django application). > > If all the modules files are importing sys module, how man

Re: Basic importing question

2008-08-20 Thread Hussein B
On Aug 20, 5:43 am, John Machin <[EMAIL PROTECTED]> wrote: > On Aug 20, 8:08 pm, Hussein B <[EMAIL PROTECTED]> wrote: > > > Hey, > > Suppose I have a Python application consists of many modules (lets say > > it is a Django application). > > If all the modules files are importing sys module, how man

Re: Basic importing question

2008-08-20 Thread John Machin
On Aug 20, 8:08 pm, Hussein B <[EMAIL PROTECTED]> wrote: > Hey, > Suppose I have a Python application consists of many modules (lets say > it is a Django application). > If all the modules files are importing sys module, how many times the > sys module will be compiled and executed? > Only once (th

Re: Basic importing question

2008-08-20 Thread Bruno Desthuilliers
Hussein B a écrit : Hey, Suppose I have a Python application consists of many modules (lets say it is a Django application). If all the modules files are importing sys module, how many times the sys module will be compiled and executed? Only once (the first time the PVM locates, compiles and exec

Basic importing question

2008-08-20 Thread Hussein B
Hey, Suppose I have a Python application consists of many modules (lets say it is a Django application). If all the modules files are importing sys module, how many times the sys module will be compiled and executed? Only once (the first time the PVM locates, compiles and executes the sys module)?