How to add a line from the first python file to another file
For example: In the second file it is:
a=[] And the first is:
from ty import a x = (15/5)*3+1 a.append(int(x)) How to make so that the value of x is stored in the list and was visible in the second file?
def print_a(): print(a)perfectly sees the contents of the listain the second file. About the fact that the value needs to be saved to the file permanently in the file system, I repeat, the question does not say a word - andreymal pmtythere is a variable with a list, for examplea = [1, 2]You want to change the list in a file from another script so that in codetyafter it becomes, for examplea = [1, 2, 10]? - gil9red pm