Ben Chuanlong Du's Blog

And let it direct your passion with reason.

Replace Single Quotes With Double Quotes in Python Code

There are 2 ways.

  1. Format the Python code using black, which will automatically convert single quotes to double quotes when applicable. (Note that you can format the code again using yapf if you want the code to formatted by yapf finally.)

  2. Use the tool myint/unify to help you.

Comments