strings in the global section
Bjoern Schliessmann
usenet-mail-0306.20.chr0n0ss at spamgourmet.com
Thu Oct 12 13:46:36 EDT 2006
Phoe6 wrote:
> But it is not so. It always prints This is a String. astring
> declared outside all the functions, is not in global section and
> values be overwritten by functions accessing it?
>
> - How is this working?
If you assign "astring" inside the function body, it's a local name.
> - What should I do to overwrite the string variable in the global
> section within functions?
Put a "global astring" in the function to access the global name
instead.
BTW, think about using a better interface than globals.
Regards,
Björn
--
BOFH excuse #23:
improperly oriented keyboard
More information about the Python-list
mailing list