How can I display email messages in Tkinter?

Jay Jen

I've been writing an email application in python/tkinter, where I download the messages from my gmail then display them in a window.

The problem I keep getting though is that most messages contain html and come out as gibberish.

Is there any way properly display the emails in tkinter, maybe without the pictures, in a way which doesn't come out as loads of html code etc. I've tried html2text but this doesn't work for all emails and still displays them pretty badly (big gaps between words etc)?

Thanks

Malik Brahimi

You can use BeautifulSoup assuming you have the HTML data and an id corresponding to the element in which the message body is contained. Please let me know if that doesn't make sense.

from bs4 import *

soup = BeautifulSoup(html_data_in_here)
text = soup.find(id = body_id).getText()

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How can I display legend in Tkinter?

From Dev

How can I be sure an email address is unique?

From Dev

How can I remove messages from a queue?

From Dev

How can I force AmazonSQSBufferedAsyncClient to flush messages?

From Dev

How can I display a meaningful login error messages to user within python-social-auth?

From Dev

How can I decode the content of the email?

From Dev

How I can parse email to get original recipient of an email?

From Dev

How I can write custom messages?

From Dev

How can I receive the missing messages in STOMP?

From Dev

how can i display data in Tkinter treeview fetched from Mysql table using python

From Dev

How can i validate email confirmation token?

From Dev

How can I display the contents of a variable that uses .sum() in a label using tkinter

From Dev

How can I display Loops

From Dev

How can I display the email of the user who has booked

From Dev

How can I display text AND variables in a tkinter text widget

From Dev

How can I display a meaningful login error messages to user within python-social-auth?

From Dev

How can I list the messages in my mailbox?

From Dev

How can I suppress these error messages?

From Dev

How can I capture messages that occur at shutdown?

From Dev

how can i split email id and display the text before @ in another textbox in asp.net c#

From Dev

How can I reply to broadcast messages?

From Dev

How can I make a button print in the display I created? (Tkinter)

From Dev

How can I set status messages in IRC?

From Dev

How can I set Thunderbird's "Recipient" column to display my email address rather than a friendly name?

From Dev

How do I filter or search email messages in Mutt by a flag?

From Dev

How can I get my error messages to display only if username or password is not entered correctly using jquery?

From Dev

How can i display info?

From Dev

How can i display a resized image in python tkinter

From Dev

How can I group messages by date?

Related Related

  1. 1

    How can I display legend in Tkinter?

  2. 2

    How can I be sure an email address is unique?

  3. 3

    How can I remove messages from a queue?

  4. 4

    How can I force AmazonSQSBufferedAsyncClient to flush messages?

  5. 5

    How can I display a meaningful login error messages to user within python-social-auth?

  6. 6

    How can I decode the content of the email?

  7. 7

    How I can parse email to get original recipient of an email?

  8. 8

    How I can write custom messages?

  9. 9

    How can I receive the missing messages in STOMP?

  10. 10

    how can i display data in Tkinter treeview fetched from Mysql table using python

  11. 11

    How can i validate email confirmation token?

  12. 12

    How can I display the contents of a variable that uses .sum() in a label using tkinter

  13. 13

    How can I display Loops

  14. 14

    How can I display the email of the user who has booked

  15. 15

    How can I display text AND variables in a tkinter text widget

  16. 16

    How can I display a meaningful login error messages to user within python-social-auth?

  17. 17

    How can I list the messages in my mailbox?

  18. 18

    How can I suppress these error messages?

  19. 19

    How can I capture messages that occur at shutdown?

  20. 20

    how can i split email id and display the text before @ in another textbox in asp.net c#

  21. 21

    How can I reply to broadcast messages?

  22. 22

    How can I make a button print in the display I created? (Tkinter)

  23. 23

    How can I set status messages in IRC?

  24. 24

    How can I set Thunderbird's "Recipient" column to display my email address rather than a friendly name?

  25. 25

    How do I filter or search email messages in Mutt by a flag?

  26. 26

    How can I get my error messages to display only if username or password is not entered correctly using jquery?

  27. 27

    How can i display info?

  28. 28

    How can i display a resized image in python tkinter

  29. 29

    How can I group messages by date?

HotTag

Archive