Python 从输入框中获取文本并插入电子邮件

Python 从输入框中获取文本并插入电子邮件,python,tkinter,Python,Tkinter,我有一个信息输入框 debnmr_tekst=StringVar() debnmr=Entry(f2,bd=3,textvariable=debnmr_tekst) debnmr.place(relx=0.5, rely=0.5, anchor=CENTER) 我喜欢在debiteur:后面的msg var中传递这些信息 尝试使用get()函数,但出现错误。希望你们能帮帮我!:) 您需要使用字符串格式将变量包含到字符串中 msg = ("""subject: Zending is afgeha

我有一个信息输入框

debnmr_tekst=StringVar()
debnmr=Entry(f2,bd=3,textvariable=debnmr_tekst)
debnmr.place(relx=0.5, rely=0.5, anchor=CENTER)
我喜欢在debiteur:后面的msg var中传递这些信息

尝试使用get()函数,但出现错误。希望你们能帮帮我!:)


您需要使用字符串格式将变量包含到字符串中

msg = ("""subject: Zending is afgehaald!

Onderstaande zending is afgehaald.

Debiteur:{}
Klant:
Aantal pallets:
Totaal gewicht:
PB nummers:

*Dit bericht is automatisch gegenereerd
""")
msg = msg.format(debnmr_tekst.get())

你能告诉我们错误是什么吗?
msg = ("""subject: Zending is afgehaald!

Onderstaande zending is afgehaald.

Debiteur:{}
Klant:
Aantal pallets:
Totaal gewicht:
PB nummers:

*Dit bericht is automatisch gegenereerd
""")
msg = msg.format(debnmr_tekst.get())