How to display rendered html content in text widget of tkinter in python 3.4.x

前端 未结 2 1535
名媛妹妹
名媛妹妹 2020-12-16 08:28

I want to display my mails as it is in text widget of tkinter in python 3.4. It can be printed as HTML formatted way by using message.HTMLBody. How do I render

2条回答
  •  执念已碎
    2020-12-16 08:38

    Short of anything past very basic HTML tkinter just wasn't built for this. There's tkhtml as one option, but anything past basic html you'll want to look elsewhere. Tk can do a lot of amazing things, but embedding webpages / content isn't really one of them.

    If you just want the text / some basic images / formatting from your mail, then you can scrape the data and then render and format it through the standard tk widgets.

    I don't really like recommending other packages / options as it tends to be highly opinionated, but check out PyQt. Specifically, the QtWebkit.

提交回复
热议问题