global instance question (newbie)

manouche emmanuel at onda-latina.com
Sun Apr 7 01:38:06 EST 2002


thank you

Chris Liechti <cliechti at gmx.net> a écrit dans le message :
Xns91E8E54158554cliechtigmxnet at 62.2.16.82...
> "manouche" <emmanuel at onda-latina.com> wrote in
> news:a8njqq$phs$1 at wanadoo.fr:
>
> > hello,
> >
> > How can I create a global object that I can be used in all the files
> > of my project?
> > Using "global" I can only access to the instance in the file where it
> > was created.
>
> put it in a separate module and import it where you need it.
> of course you can add and modify the values on that module.
>
> there is only one module instance in the interpreter, no matter how much
> you import it (singelton is the keyword).
>
> chris
>
> --
> Chris <cliechti at gmx.net>
>





More information about the Python-list mailing list