I wrote a program that sends me a calculated variable via gmail. However, I only see a couple of rows from the whole list out of the 147 rows which should be seen[this is what I get 1 but I would like to see every row.
I've found a similar problem: Output data from all columns in a dataframe in pandas but it only displays properly in the shell. When I tried these methods mentioned in the link, I've got a message which contained only: "None" or a completely blank message. I have no idea why it isn't working.
My code:
import pandas as pd
import smtplib
import tabulate
from io import StringIO
colnames = ['Hatarmetszek', 'Ora', 'diff']
data = pd.read_csv('calculatedvalue.csv', names=colnames)
gmail_user='mvm.napiadat@gmail.com'
gmail_password='password'
print (data) #modification work here
msg = "\r\n".join([
"From: user_me@gmail.com",
"To: user_you@gmail.com",
"Subject: napi adatok",
"",
str(data) # but don't here, this is the original one, which sends me the picture
])
sent_from='mvm.napiadat@gmail.com'
to=['bnyakas@mvmp.hu']
server=smtplib.SMTP('smtp.gmail.com', 587)
server.ehlo()
server.starttls()
server.login(gmail_user,gmail_password)
server.sendmail(sent_from,to,msg)
server.quit()
Any help is appreciated.
Thank you.