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 …

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 …

Tips on pyenv

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

pyenv lets you easily switch between multiple versions of Python. It's simple, unobtrusive, and follows the UNIX tradition of single-purpose tools that do one thing well.

Install pyenv

curl https://pyenv …

Static Type Checking of Python Scripts Using Mypy

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

--check-untyped-defs

You can use the option --ignore-missing-imports to disable the annoying error messages No library stub file for module.... Please see the issue for more details.

You can use # type: ignore …