Guides

Python

View as Markdown

This guide was heavily inspired by Jack Fields and his article about setting up VS Code for Python development. Please check his article for more details.

Prerequisites

Before you begin, make sure you have:

  • Python installed (3.8 or higher recommended)
  • Git for version control
  • Grok Build installed and updated to the latest version

Essential extensions

The following extensions setup Grok Build to be fully featured for Python development. These provide you with syntax highlighting, linting, debugging and unit testing.

Advanced Python tooling

While the above extensions have previously been the most popular extensions for Python development in Grok Build, these additional extensions help you get more out of Python development.

uv - Python environment manager

uv is a modern Python package manager that can be used to create and manage virtual environments, in addition to replacing pip as the default package manager.

To install uv, run the following command in your terminal:

Bash

pip install uv

ruff - Python linter and formatter

Ruff is a modern Python linter and formatter that can be used to check for programming errors, helps enforce coding standards, and can suggest refactoring. It can be used alongside Black for code formatting.

To install Ruff, run the following command in your terminal:

Bash

pip install ruff

Grok Build configuration

1. Python interpreter

Configure your Python interpreter in Grok Build:

  1. Open Command Palette (Cmd/Ctrl + Shift + P)
  2. Search for "Python: Select Interpreter"
  3. Choose your Python interpreter (or virtual environment if you're using one)

2. Code formatting

Set up automatic code formatting with Black:

Black is a code formatter that automatically formats your code to follow a consistent style. It requires zero configuration and is widely adopted in the Python community.

To install Black, run the following command in your terminal:

Bash

pip install black

Then, configure Grok Build to use Black for code formatting, by adding the following to your settings.json file:

JSON

{
  "python.formatting.provider": "black",
  "editor.formatOnSave": true,
  "python.formatting.blackArgs": ["--line-length", "88"]
}

3. Linting

PyLint checks for programming errors, enforces coding standards, and suggests refactors.

To install PyLint, run the following command in your terminal:

Bash

pip install pylint

JSON

{
  "python.linting.enabled": true,
  "python.linting.pylintEnabled": true,
  "python.linting.lintOnSave": true
}

4. Type checking

In addition to linting, MyPy checks for type errors.

To install MyPy, run the following command in your terminal:

Bash

pip install mypy

JSON

{
  "python.linting.mypyEnabled": true
}

Debugging

Grok Build provides these debugging capabilities for Python:

  1. Set breakpoints by clicking the gutter
  2. Use the Debug panel (Cmd/Ctrl + Shift + D)
  3. Configure launch.json for custom debug configurations

Framework support

Grok Build works with popular Python frameworks:

  • Web Frameworks: Django, Flask, FastAPI
  • Data Science: Jupyter, NumPy, Pandas
  • Machine Learning: TensorFlow, PyTorch, scikit-learn
  • Testing: pytest, unittest
  • API: requests, aiohttp
  • Database: SQLAlchemy, psycopg2

Last updated: November 23, 2026