I have 2 Python scripts:
ScriptSmall.py:
a=9
ScriptBig.py:
a=5
print(a)
f=open('ScriptSmall.py')
exec(f.read())
f.close
print(a)
When I run ScriptBig.py in the terminal as python3 ScriptBig.py
, the terminal prints out:
$python3 ScriptBig.py
5
5
I would like it to print out 5
and then 9
. What I am doing wrong?