I have two files file 1 contains 3 variables
file1
var1 = 1
var2 = 2
var3 = 3
this file1 is constantly updated by an update file that opens file1 and changes the values. It works.
Now I have file2 and want to grab, also in a while loop, the values var1 to var3 from file1. first loop in file2 I get the values but the next loops , even when the values var1 to var 3 in file1 changes, they are not beeing updated.
update file
while True:
var1 = api code
var2 = api code
var3 = api code
with open("path\file1.py", "a") as f:
f.truncate(0)
f.write(var1,var2,var2)
file 2
while True:
from file1 import var1,var2,var3
print(var1,var2,var3)
Can you please tell me why the values in file2 are not beeing updated from file1 and how can I change it. Thanks