> Use a module and a class variables for that.
I think we could manage a little example too ;-) This one is a fictitious
little game project where the user can define a custom graphics directory on
the command line.
Three files: game.py, graphics.py and common.py.
The common.py file contains
Anton81 wrote:
> Hi,
>
> I want to use globals that are immediately visible in all modules. My
> attempts to use "global" haven't worked. Suggestions?
>
> Anton
I think a dictionary would work here
as well as list but not strings and int's
# module1
settings = {
"release" : "1.0",
Anton81 <[EMAIL PROTECTED]> writes:
> I want to use globals that are immediately visible in all modules. My
> attempts to use "global" haven't worked. Suggestions?
Use a module and a class variables for that. Import your module and
read/update class variables as you need them.
--
Jorge Godoy
Hi,
I want to use globals that are immediately visible in all modules. My
attempts to use "global" haven't worked. Suggestions?
Anton
--
http://mail.python.org/mailman/listinfo/python-list