Ben Chuanlong Du's Blog

It is never too late to learn.

Tips on Nox

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

It is suggested that you leverage profession CICD tools instead of nox for testing.

https://github.com/theacodes/nox

https://nox.thea.codes/en/stable/index.html

https://cjolowicz.github.io …

Read Text File into a pandas DataFrame

Advanced Options

  1. The argument sep supports regular expression! For example,

     :::python
     df = pd.read_csv(file, sep+" +")

nrows: control the number of rows to read skiprows, skip blank lines (the default behavior)

namesarray-like, optional List of column names to use. If the file contains a header row, then you should explicitly pass header=0 to override the column names. Duplicates in this list are not allowed.

Send Emails in Python

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

Use Standard Libraries smtplib and email

Below is a function for sending email leveraging standard libraries smtplib and email.

import smtplib
from email.mime.text import MIMEText


def send_email(recipient: Union …