reading raw variables from file

Martin Blume mblume at socha.net
Sun Dec 2 12:32:10 EST 2007


"MonkeeSage" schrieb 
> >
> > If I have understood python naming scoping correctly,
> > doing
> >    my_var="hello"
> >    import stuff
> >    print my_var
> > is not the same as
> >    my_var="hello"
> >    exec open("stuff.py").read()
> >    print my_var
> > with stuff.py containing
> >    my_var="bye"
> 
> It's not the same...
> 
> from stuff import *
> 
> ...is.
> 
And indeed it is. Thanks.
Martin




More information about the Python-list mailing list