Dave Angel wrote:
The point you should get from that link is
Don't do circular imports. Ever.
No, I would say the lesson to be learned from this is
don't use the same file as both a main script and an
imported module.
I would create another file called e.g. 'main.py' that
simply contains
greg wrote:
div class=moz-text-flowed style=font-family: -moz-fixedDave
Angel wrote:
The point you should get from that link is
Don't do circular imports. Ever.
No, I would say the lesson to be learned from this is
don't use the same file as both a main script and an
imported module.
I
On Sunday, 11 October 2009 02:24:34 Stephen Hansen wrote:
It's really better all around for modules to be considered like
libraries, that live over There, and aren't normally executed. Then you
have scripts over Here which may just be tiny and import a module and call
that module's main
On Oct 10, 7:36 pm, Stef Mientki stef.mien...@gmail.com wrote:
hello,
I always thought code in a module was only executed once,
but doesn't seem to be true.
I'm using Python 2.5.
And this is the example:
== A.py ==
My_List = []
== B.py ==
from A import *
My_List.append ( 3 )
print
thanks very much Stephen,
This is the first time I become aware of the difference between script
and module !!
Starting with the wrong book Learning Python second edition, from Lutz
and Ascher, based on Python 2.3
in combination with using Python only from a high level IDE
(PyScripter),
(please don't top-post. Put your reply *after* the message you're quoting.)
Stef Mientki wrote:
div class=moz-text-flowed style=font-family: -moz-fixedthanks
very much Stephen,
This is the first time I become aware of the difference between script
and module !!
Starting with the wrong book
ryles wrote:
I always thought code in a module was only executed once,
but doesn't seem to be true.
I'm using Python 2.5.
And this is the example:
== A.py ==
My_List = []
== B.py ==
from A import *
My_List.append ( 3 )
print 'B', My_List
import C
== C.py ==
from A import *
from
hello,
I always thought code in a module was only executed once,
but doesn't seem to be true.
I'm using Python 2.5.
And this is the example:
== A.py ==
My_List = []
== B.py ==
from A import *
My_List.append ( 3 )
print 'B', My_List
import C
== C.py ==
from A import *
from B import *
print
Stef Mientki stef.mientki at gmail.com writes:
Why is the B.py executed twice ?
Because it's executed once as a script and once as a module.
--
http://mail.python.org/mailman/listinfo/python-list
On Sat, Oct 10, 2009 at 4:36 PM, Stef Mientki stef.mien...@gmail.comwrote:
hello,
I always thought code in a module was only executed once,
but doesn't seem to be true.
This is one of the reasons why that whole big mess of a ton separate scripts
that all call each-other and are sometimes
10 matches
Mail list logo