Re: [Tutor] dynamic attribute assignment

2007-09-07 Thread Alan Gauld
"John" <[EMAIL PROTECTED]> wrote vars.var3 > ['a','b','c'] > > This is great, I had no idea! However, is there then a way to > reassign or > update the values? For instance, can you say: > vars.var1='some new text' Why not try it at the >>> prompt? Thats the great thing about python, i

[Tutor] dynamic attribute assignment

2007-09-06 Thread John
I've just noticed that you can use the import statement to import variables, such that a simple file such as vars.py: # File with predefined variables var1= 'some text' var2= 2 var3=['a','b','c'] Would then, upon import, provide: >>>vars.var1 'some text' >>>vars.var2 2 >>>vars.var3 ['a','b','c']