Here is a quick guide on how to set up Python Black and isort in visual studio code. isort and Black works really well together and comes baked in starting with version 5. All we need to do to use isort alongside Black is to set the isort profile to “–profile=black”.

{
  "python.pythonPath": "venv\\Scripts\\python.exe",
  "editor.formatOnSave": true,
  "python.formatting.provider": "black",
    "python.formatting.blackArgs": [
      "--line-length=119"
  ],
  "python.sortImports.args": [
    "--profile=black",
  ],
  "[python]": {
    "editor.codeActionsOnSave": {
        "source.organizeImports": true
    }
  } 
}

Subscribe: https://www.youtube.com/channel/UC1mxuk7tuQT2D0qTMgKji3w

#python #vscode #visual-studio

Set up Python Black and isort on Visual Studio Code
10.70 GEEK