Ben Chuanlong Du's Blog

It is never too late to learn.

Fix Version Confliction of the Six Package

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

ERROR: jsonschema 3.1.1 has requirement six>=1.11.0, but you'll have six 1.10.0 which is incompatible.

sudo pip3 install six -U

Update a Line in Standard Output

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

The trick is to use \r (return) instead \n (return and new line). I will use Python to illustrate. The following Python code

:::Python import sys

for idx in range(5 …

Understand the Design of Python

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

Design

  1. There is no constant variables in Python. If you need a constant variable in Python, just define one and never change it. It is suggested that you use UPPER_WITH_UNDERSCORE naming …

Calling Shell from Python

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

  1. subprocess.run is preferred to the function os.system for invoking shell commands. For more discussions, pleaser refer to [Hands on the Python module subprocess]https://www.legendu.net/en/blog …