Install Black in your virtual environment:
$ pip install black
Install Microsoft's Python extension in VSCode:
Open your VSCode settings, by going 'Code -> Preferences -> Settings'.
Search for "python formatting provider" and select "black" from the dropdown menu:
Black will now format your code whenever you save a
Images from VSCode using Hyper Term Theme.