I have a simple Python module file First.py:
a = 50
b = [100,200,300]
I try to import this module into another file Test.py:
import First
First.a = 420
First.b[0] = 420
print (First.a)
My purpose is to change the list values inside the First module.
Once the script Test.py completes when I print the values inside the module , I find that the values have not changed.
Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:01:18) [MSC v.1900 32 bit (I
tel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import First
>>> dir(First)
['__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__',
'__package__', '__spec__', 'a', 'b']
>>> First.a
50
>>> First.b
[100, 200, 300]
What am I missing here? Can someone kindly guide me?