I have the following issue with my python script. There are a lot of calculations, and I want to write some of the final results into a text file.
This is what I have tried so far :
a1=3
a2=5
a3=10
a4=15
setupfile = open("setupfile.txt","w")
x = [a1,a2,a4]
for name in x:
setupfile.write("name" + "=" + repr(name) +"\n")
setupfile.close()
Current output :
name=3
name=5
name=15
Expected output :
a1=3
a2=5
a4=15