By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,035 Members | 1,995 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,035 IT Pros & Developers. It's quick & easy.

Global object

P: n/a
Hi all, i need to save in an object some variable for use in other
parts of my software. it's possibile without create an istance of this
class in every file? if yes how?
thanks a lot

Ghido

Nov 22 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Ghido wrote:
Hi all, i need to save in an object some variable for use in other
parts of my software. it's possibile without create an istance of this
class in every file? if yes how?
Create a module, say, ``config``. Then to save your object, you use
something like::

import config
config.value = value_to_save

Now if you want to access it from other parts of your program, simply
write::

import config
do_something_with(config.value)

STeVe
Nov 22 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.