Ben Chuanlong Du's Blog

It is never too late to learn.

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 …

Hands on the tqdm Module in Python

Simple Use Case

The usage of the tqdm module is really simple. All you need is to import the tqdm function from the tqdm module, and then wrap the function tqdm over the iterable object that you want iterate over. This is really convenient if you have a long running task and want to report the progress of the task.

Ensure Capturing Log of Applications

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

Logging is critical for debugging applications. For production applications, it is best to send log information into a file instead of the standard output so that the log information is persisted …