Have made a python GUI and now I want to store the variable say Reference and Total cost in a file.
How can I achieve that?
Have tried writing a file like:
def writetofile():
import os
outputname ='tutorial.txt'
a= "TotalCost"
myfile = open(outputname,'w')
myfile.write('File A value is : ' + str(a) + '\n')
myfile.close()
if os.stat(outputname).st_size > 0:
print("tutorial.txt file has been populated")
else:
print("the output value is empty")
print("The A value should read: " + str(a) + '\n')
writetofile()
but only the text is coming, not the calculated value of TotalCost