[Tutor] Global presets ?
alan.gauld at freenet.co.uk
Sun Dec 5 00:35:32 CET 2004
> >myvars.value2 = 'Alan'
> Never thought of setting 'myvars.value2 = 'Alan'' I guess this
> just set the variable in the myvars namespace since it could not
> myvars.py itself.
Absolutely correct and why I put the example in - but I forgot
to point out the hidden gotcha! Glad you figured it out ;-)
> >print myvars.value1 - 27
> Have I misunderstood, should this not be 42 ? Typo or me not
value1 is 42 so the print statement prints 42-27 => 15
Just proving that you can use the values any way you like,
including in expressions.
More information about the Tutor