global variable confusion

2009-02-02 Thread Robert D.M. Smith
I have a question on global variables and how to use them. I have 2 files; a.py & b.py # a.py - myvar = { 'test' : '123' } # --- # b.py - from a import myvar def test(): a.myvar = { 'blah' : '456' } # - If I *'import a*' & type *'a.myvar'* it prints 'test' & '123'. Now

global variable confusion

2009-02-03 Thread rdmurray
"Robert D.M. Smith" wrote: > I have a question on global variables and how to use them. I have 2 files; > a.py & b.py > > # a.py - > > myvar = { 'test' : '123' } > > # --- > # b.py - > > from a import myvar > > def test(): > a.myvar = { 'blah' : '456' } > > # - > > If

Re: global variable confusion

2009-02-02 Thread Chris Rebert
On Mon, Feb 2, 2009 at 10:25 PM, Robert D.M. Smith wrote: > I have a question on global variables and how to use them. I have 2 files; > a.py & b.py > > # a.py - > > myvar = { 'test' : '123' } > > # --- > # b.py - > > from a import myvar > > def test(): > a.myvar = { 'blah' : '45