dailylog 8-10-20

less than 1 minute read

THINGS I LEARNED TODAY

ITERATE OVER PYTHON DICTIONARY

for k,v in members.items():
    print(k,v)

ITERATE OVER ROWS IN PANDAS

for index, row in df.iterrows():
    print(row['COLUMN1'], row['COLUMN2'])

USING THE FORMAT FUNCTION

SO with many more examples incluing dict dictionary

string = "The girl named {name} really loved her cat named {catname}".format(name="Clara", catname="Uli")
# 'The girl named Clara really loved her cat named Uli'

ADDING BCC TO SMTP

SO

ADD BOTH EMAIL AND NAME with ADDRESS(name, email)

DOCS

import smtplib

from email.message import EmailMessage
from email.headerregistry import Address
from email.utils import make_msgid

# Create the base text message.
msg = EmailMessage()
msg['Subject'] = "Ayons asperges pour le déjeuner"
msg['From'] = Address("Pepé Le Pew", "pepe", "example.com")
msg['To'] = (Address("Penelope Pussycat", "penelope", "example.com"),
             Address("Fabrette Pussycat", "fabrette", "example.com"))

Search terms to help future self

How to iterate over rows in a Data Frame

Print rows in data frame

Print rows in pf

Pandas print rows