-1
我有2個文本小部件(tkinter)。但是,當我從兩者得到的文本並嘗試將其寫入TXT文件中一行,它寫在第二行(從第1小部件,然後從第二) 這裏是代碼:結合TKInter中2個文本小部件的文本
def makeIt():
s = facttext.get("1.0", END)
count = counttext.get("1.0")
final = "<string name=\"fact" + count + "\">" + s + "</string>"
easygui.msgbox(final, title="olol")
with open("text.txt", 'a') as out_file:
out_file.write(final)