I'm using Python to open a text document:
text_file = open("Output.txt", "w")
text_file.write("Purchase Amount: " 'TotalAmount')
text_file.close()
I want to enter the string called "TotalAmount" into the text document. Can someone please let me know how to do this?
then you can use Print Function :
this is the example of Python Print String To Text File