when fun() is run it should insert the script of external.py in main_script.py and run like a single file.
def fun(): x1 = 60 x2=80 exec(open('second.py').read()) return(z1,z2) print(fun()) # should print value to z1 and z2;
z1=x1+x2 z2=x1-x2
2.1m questions
2.1m answers
60 comments
57.0k users