[Tutor] Alan Gauld's tut - namespaces

John Connors oztriking at hotmail.com
Wed Apr 26 23:44:20 CEST 2006


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 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
>explantaion.
>
>With warm regards,
>-Payal
>_______________________________________________
>Tutor maillist  -  Tutor at python.org
>http://mail.python.org/mailman/listinfo/tutor

_________________________________________________________________
15,000 Velocity Points Velocity NAB Credit Card 
http://a.ninemsn.com.au/b.aspx?URL=http%3A%2F%2Fadsfac%2Enet%2Flink%2Easp%3Fcc%3DNAT030%2E23080%2E0%26clk%3D1%26creativeID%3D34301&_t=754983092&_r=emailtagline&_m=EXT



More information about the Tutor mailing list