0

I found a solution for writing to file what prints to the screen...

import sys
global saveFile
saveFile = open((fileName)+'.txt','w')
sys.stdout = saveFile
print("THIS QUOTE HAS BEEN BROUGHT TO YOU BY 'PAINTED'.")
print("Customer ID:", fileName)
print("Total Wall Area:", format(WallArea, '.2f'), "m²")
print("Total Window Area:", format(WindowArea, '.2f'), "m²")
print("Total Door Area:", format(DoorArea, '.2f'), "m²")
print("Overall Paint Area:", format(PaintArea, '.2f'), "m²")
print("At £", format(costPer, '.2f'), "Per Square Metre.")
print("Final Quote Price: £", format(FinalPrice, '.2f'), "Plus VAT")
saveFile.close()

So it creates the file like I want it to and writes all that data to it but now it doesn't print in console for the user to see? How can I get it to print it to screen and the write to file.

0 Answers0