global variables or inheritence

Gordon McMillan gmcm at hypernet.com
Wed Apr 26 23:17:56 CEST 2000


Thomas Rasmussen wrote:

> I have quite a big problem. I have two different files, where I
> in one file want to declare a variable and then in the other file
> be able to access and use this variable (no need to change it),
> but I just can't seem to get it to work... Is there any nice way
> of doing this easily? I have tried the global var but this
> doesn't seem to work.
> 
> Anyone got a good idea?

  import other
  print other.something

works just fine. Bet you used "from other import *", and then 
tried to change the value in other.

- Gordon




More information about the Python-list mailing list