Ben Chuanlong Du's Blog

It is never too late to learn.

Python Developing in PyCharm

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

Change Scheme

  1. File -> Settings... -> Editor -> Colors & Fonts

  2. Choose a scheme right to "Scheme name"

Change Font of Terminal

  1. Search for Console Font

  2. Set the desired font size.

  3. Restart terminal (the font …

Tips on ANTLR4

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

Install ANTLR4 in Ubuntu

wajig install antlr4
sudo pip3 install antlr4-python3-runtime==4.5

References

Connect to MySQL Using PyMySQL

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

sudo pip3 install PyMySQL

Tricks

  1. Connection in PyMySQL is not autocommit by default. You must commit to save your changes.

    # suppose conn is the connection object
    conn.commit()
    
  2. parameterized sql: %s …

Connect to Databases Using pyodbc in Python

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

pyodbc only supports qmark

https://github.com/mkleehammer/pyodbc/wiki

Unicode Converter Buffer Overflow

This issues arises in Python3 but not Python2, so the simplest way is to use Python2 if …

Tips on Python Flask

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

app.run(host= '0.0.0.0')

  1. jsonify auto does the conversion between None (Python) and null (JS).