I'm using Python to open a text document: 我正在使用Python打开文本文档: this
text_file = open("Output.txt", "w") text_file.write("Purchase Amount: " 'TotalAmount') text_file.close()
I want to substitute the value of a string variable TotalAmount
into the text document. 我想将字符串变量TotalAmount
的值TotalAmount
为文本文档。 Can someone please let me know how to do this? 有人可让我知道该怎么作吗? spa