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