A
alex
Hi,
is it possible to create 'global' variables that can be seen in all
other classes?
Alex
is it possible to create 'global' variables that can be seen in all
other classes?
Alex
Not sensibly, though you can mess around with the __builtin__ namespacealex said:Hi,
is it possible to create 'global' variables that can be seen in all
other classes?
Alex
Hello,alex said:Hi,
is it possible to create 'global' variables that can be seen in all
other classes?
Alex
M.E.Farmer said:What about using a class?
Py> class globalVar:
... pass
Py> globals = globalVar()
Well, since he signs himself "Steve" too I guess we'll just have to putM.E.Farmer said:Ok it has been a long day,
In my reply to Steven Bethard , Steve should read Steven
M.E.Farmer
Steve Holden said:Well, since he signs himself "Steve" too I guess we'll just have to put
up with the ambiguities. Or perhaps, given my (lack of) typing skill, I
should just start signing myself "Stvev"?
Probably naming it something other than 'globals' would be a good idea
-- otherwise you'll hide the builtin globals() function.
But I agree that the attributes of a class instance (as you suggest)
or the attributes of a module (as Steve Holden suggests) is probably
the right way to go.
Steve said:Well, since he signs himself "Steve" too I guess we'll just have to put
up with the ambiguities. Or perhaps, given my (lack of) typing skill, I
should just start signing myself "Stvev"?
regards
Steve
Steven said:Steve said:Well, since he signs himself "Steve" too I guess we'll just have to
put up with the ambiguities. Or perhaps, given my (lack of) typing
skill, I should just start signing myself "Stvev"?
regards
Steve
Or I can stop correcting it every time I type STeve[1].
STeve
[1] But of course, you probably do the same thing too.![]()
There we go, much clearer![]()
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.