Re: unable to read the __main__ namespace

2009-12-13 Thread vsoler
On Dec 13, 12:34 pm, Chris Rebert wrote: > On Sun, Dec 13, 2009 at 3:20 AM, vsoler wrote: > > I'm learning Python, and I am very fond of it. > > > Using Python 2.6 > > > I am able to list all the names in a class namespace: > > > class abc: pass > > abc.a1=7 > > abc.a2='Text' > > > print abc.__di

Re: unable to read the __main__ namespace

2009-12-13 Thread Peter Otten
vsoler wrote: > I'm learning Python, and I am very fond of it. > > Using Python 2.6 > > I am able to list all the names in a class namespace: > > class abc: pass > abc.a1=7 > abc.a2='Text' > > print abc.__dict__.keys() > > a) However, I do not know how to read the __main__ namespace > > prin

Re: unable to read the __main__ namespace

2009-12-13 Thread Chris Rebert
On Sun, Dec 13, 2009 at 3:20 AM, vsoler wrote: > I'm learning Python, and I am very fond of it. > > Using Python 2.6 > > I am able to list all the names in a class namespace: > > class abc: pass > abc.a1=7 > abc.a2='Text' > > print abc.__dict__.keys() That is more simply written as: print dir(ab

unable to read the __main__ namespace

2009-12-13 Thread vsoler
I'm learning Python, and I am very fond of it. Using Python 2.6 I am able to list all the names in a class namespace: class abc: pass abc.a1=7 abc.a2='Text' print abc.__dict__.keys() a) However, I do not know how to read the __main__ namespace print __main__.__dict__.keys()# Just does not