egasimus wrote:
Hi, newbie here. I've read on using the 'global' keyword being
discouraged; then what is the preferred way to have something, for
example a class containing program settings, accessible from
everywhere, in a program spanning multiple files?

Python's 'global' keyword is global in a file (module), not global
across multiple files, so it would have helped you anyway.

If you want program settings accessible across multiple modules then put
the settings in a module and import that module in any other module that
needs to access them.
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to