Ben Chuanlong Du's Blog

It is never too late to learn.

Get Total Physical Memory in Python

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

Using os.sysconf

Notice that this ways only works on Linux but not on macOS or Windows.

Get physical memory in bytes.

Hands on Python IO

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

StringIO

Tools for Symbolic Computation

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

Mathematica

The best one that I've ever used, but commercial unfortunately.

sympy …

Git Implementations and Bindings in Python

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

There are multiple Git implementations/bindings in Python: pygit2, Dulwich and GitPython .

Below is a simple comparison of the 3 packages.

pygit2 dulwich GitPython
Implementation bindings to libgit2 pure Python bindings …

Tips on Python Build Standalone

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

The GitHub repository python-portable has some example scripts for bundling standalone Python environments. It also releases standalone Python environemnts regularly.

Tips on Using env_python.tar.gz

This section is specifically on …

Hands on the Deque Collection in Python

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

Tips and Traps

  1. A deque is implemented via the circular queue data structure and it has O(1) time complexity appending from both ends.

  2. Unlike list and tuple collections, a deque CANNOT be sliced!