将字符串打印到文本文件 - Print string to text file

问题:

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


解决方案:

参考一: https://stackoom.com/question/LsY6/将字符串打印到文本文件
参考二: https://oldbug.net/q/LsY6/Print-string-to-text-file
相关文章
相关标签/搜索