Recent Posts

(TIL) Python: Private variables

less than 1 minute read

To make Python treat a variable as pseudo-private, follow the convention of putting two underscores (i.e., __) at the beginning of the variable’s name, e.g.:

(TIL) Python: Flushing while printing

less than 1 minute read

Since Python 3.3, you can force the normal print() function to flush without the need to use sys.stdout.flush(); just set the flush keyword argument to Tr...

(TIL) Python: Pickle in Python2 and Python3

less than 1 minute read

The python3 pickle.load() function has optional keyword arguments that can be used to control compatibility support for pickle stream generated by Python 2: