Dec-06-2019, 09:56 PM
I have a solution. It is similar to code I wrote recently for another post, the idea being that in main.py you will copy the contents of time.py to another file, time1.py, and import that.
main.py
main.py
with open("time.py",'r') as file1: program = file1.readlines() with open('time1.py','w') as file2: file2.writelines(program) import time1 x = 2 y = 3 print(time1.soma(x,y))time.py
def soma(x,y): return x+y