I am trying to code a "parent" py file that can execute multiple py files on it.
The structure is like the follow if i simplify.
parent.py
- childeren1.py
And inside the parent.py it executes children1.py in this way.
**parent.py**
a = 0
with open ("children1.py", "r", encoding="utf-8") as file:
exec(file.read())
file.close()
print(a)
Inside the "children1.py",
**children1.py**
a = 1
If I run parent.py, it returns a=1 which is the result from the children1.py
I want it to be a=0 though.
Can I clear the variable that is used in the children1.py after its execution has finished whatever the variable was in exec()?
I want the variables in parent.py to be absolute.