Life is short. Be grateful

Difference between __init__() and __new__() method in Python

|

Background

In Pyhton, there are some built-in functions when creating a class that looks like __func_name__. There are two of them, __new__ and __init__. I found it’s very interesting that we seldomly use __new__ but mostly just use __init__. But actually they are bit different and are all useful for different senarios.

How to use Python FastAPI and NGINX to deploy a web app with docker compose

|

Background

FastAPI is a high performance web framework in Python 3.6+ that booming very fast recently. While NGINX is one of the most popular open source load balancer that been used widely as a reverse proxy in front of the app.

How to install MySQL and MySQL Workbench with docker compose

|

Background

MySQL is one of the most popular open source relational database management system (RDBMS) thus a good tool for learning SQL. This artical shows how to quickly implement a MySQL env locally with docker-compose and visit it by a GUI called MySQL workbench.

The Usage of *args and **kwargs in Python

|

What

In a python function, we need to pass params but sometimes you may find two weird thing like *args or **kwargs. These two special charactors means we can pass multiple arguments or keyword arguments to a function.

The Order of Basic SQL execution

|