[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] setting + modifying a variable for use across the entire application



ooh 'mutated' ?? that is cool man.

On Fri, Dec 2, 2011 at 1:16 PM, René Dudfield <renesd@xxxxxxxxx> wrote:
> Arg... one more time with bug fixed.
>
>
>
> # config.py
> someconfigvar = "hello"
>
>
> #Then in each module you can just do...
>
>
> # file1.py
> import config
> config.mutated = 1
>
>
> #file2.py
> import config
> x = config.mutated
>
>
> #file3.py
> import file1
> import file2
>
> print (file2.x) # should print 1



-- 
A musician must make music, an artist must paint, a poet must write,
if he is to be ultimately at peace with himself.
- Abraham Maslow