Taken from www.python.org, FAQ 2.3 How do I share global variables
across modules?
config.py:
x = 0 # Default value of the 'x' configuration setting
mod.py:
import config
config.x = 1
main.py:
import config # try removing it
import mod
print config.x
The example, such as shown in
On May 16, 4:42 pm, vsoler vicente.so...@gmail.com wrote:
Taken fromwww.python.org, FAQ 2.3 How do I share global variables
across modules?
config.py:
x = 0 # Default value of the 'x' configuration setting
mod.py:
import config
config.x = 1
main.py:
import config # try
On Sun, 16 May 2010 22:42:40 +0100, vsoler vicente.so...@gmail.com wrote:
Taken from www.python.org, FAQ 2.3 How do I share global variables
across modules?
config.py:
x = 0 # Default value of the 'x' configuration setting
mod.py:
import config
config.x = 1
main.py:
import config
On 17 mayo, 00:05, Patrick Maupin pmau...@gmail.com wrote:
On May 16, 4:42 pm, vsoler vicente.so...@gmail.com wrote:
Taken fromwww.python.org, FAQ 2.3 How do I share global variables
across modules?
config.py:
x = 0 # Default value of the 'x' configuration setting
mod.py:
On Mon, May 17, 2010 at 8:26 AM, vsoler vicente.so...@gmail.com wrote:
However, can I be 100% sure that,no matter how I access variable
'x' (with config.x or mod.config.x) it is always the same 'x'. I mean
that either reference of 'x' points to the same id(memory position)?
Yes it does unless
On 17 mayo, 00:38, James Mills prolo...@shortcircuit.net.au wrote:
On Mon, May 17, 2010 at 8:26 AM, vsoler vicente.so...@gmail.com wrote:
However, can I be 100% sure that,no matter how I access variable
'x' (with config.x or mod.config.x) it is always the same 'x'. I mean
that either
On May 16, 5:38 pm, James Mills prolo...@shortcircuit.net.au wrote:
On Mon, May 17, 2010 at 8:26 AM, vsoler vicente.so...@gmail.com wrote:
However, can I be 100% sure that,no matter how I access variable
'x' (with config.x or mod.config.x) it is always the same 'x'. I mean
that either
On 17 mayo, 00:52, Patrick Maupin pmau...@gmail.com wrote:
On May 16, 5:38 pm, James Mills prolo...@shortcircuit.net.au wrote:
On Mon, May 17, 2010 at 8:26 AM, vsoler vicente.so...@gmail.com wrote:
However, can I be 100% sure that,no matter how I access variable
'x' (with config.x or