An Interest In:
Web News this Week
- April 19, 2024
- April 18, 2024
- April 17, 2024
- April 16, 2024
- April 15, 2024
- April 14, 2024
- April 13, 2024
April 30, 2020 09:40 pm GMT
Original Link: https://dev.to/adamlombard/how-to-use-the-black-python-code-formatter-in-vscode-3lo0
How to use the Black Python code formatter in VSCode
Black is "the uncompromising Python code formatter." It can be configured to automatically format your code whenever you save a file in VSCode.
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:
In the settings, search for "format on save" and enable the "Editor: Format on Save" option:
Black will now format your code whenever you save a *.py
file.
Images from VSCode using Hyper Term Theme.
Original Link: https://dev.to/adamlombard/how-to-use-the-black-python-code-formatter-in-vscode-3lo0
Share this article:
Tweet
View Full Article
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To