Alan Gauld wrote:
> However I'll refrain from saying much more since I do think the
> namespaces topic could be significantly improved if only I could
> find better words and examples.
Hi Alan,
Looking at the tutorial, I think it jumps too quickly to more advanced
material (multiple modules) bef
G'day Alan,
>However I'll refrain from saying much more since I do think the
>namespaces topic could be significantly improved if only I could
>find better words and examples.
>
>So please everyone, feel free to try to explain this idea to Payal
>so that I can steal your ideas for the tutorial!!
"Payal Rathod" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> In Alan's tutorial I haven't got the example of print42() even after
> reading the explanation.
> I get 110 if I use it as a function.
>
spam = 42
def print42(): print spam
> ...
spam = 110
print42()
>
G'day Payal,
I had trouble understanding the namespaces section of the tutorial too but
it all clicked the other day when Alan explained the difference between
import first and from first import *
John
>Hi,
>In Alan's tutorial I haven't got the example of print42() even after
>reading the expl
Hi,
In Alan's tutorial I haven't got the example of print42() even after
reading the explanation.
I get 110 if I use it as a function.
>>> spam = 42
>>> def print42(): print spam
...
>>> spam = 110
>>> print42()
110
Why do you get 42 when you use it as module? I haven't understood the
explantai