Skip to content Skip to sidebar Skip to footer

How To Send Correctly A Table By Email In Python?

i trying to send a ASCII table by email but when i received i got a unexpected format the format that shows in my python script is from tabulate import tabulate message_launch = ['

Solution 1:

Most email clients support html rendering. I think that would be the easiest way.

Pass 'html' to tablefmt:

t = tabulate(message_launch, headers=message_headers, missingval='?', stralign='center', tablefmt='html').encode('utf-8')

Then send t as html with whatever email library you are using.


Post a Comment for "How To Send Correctly A Table By Email In Python?"