Development Environment
While you can write Python in Notepad or TextEdit, you shouldn’t. A good Integrated Development Environment (IDE) provides syntax highlighting, code completion, error checking, and debugging tools.
We recommend Visual Studio Code (VS Code), the industry standard for Python development.
Installing VS Code
Section titled “Installing VS Code”- Download it from code.visualstudio.com.
- Install it like any standard application.
Configuring for Python
Section titled “Configuring for Python”VS Code is a general-purpose editor. To make it a Python IDE, we need to install extensions.
-
Open Extensions: Click the Extensions icon in the Activity Bar on the side (or press
Ctrl+Shift+X). -
Search: Type “Python”.
-
Install: Look for the extension named Python published by Microsoft (usually the top result with millions of downloads). Click “Install”.
This will also install Pylance (for intelligence/autocompletion) and the Python Debugger.
Selecting Your Interpreter
Section titled “Selecting Your Interpreter”This is the most common point of confusion for beginners. VS Code needs to know which Python installation to use (e.g., the global one, or a virtual environment).
- Open the Command Palette (
Ctrl+Shift+PorCmd+Shift+P). - Type and select:
Python: Select Interpreter. - Choose the version you just installed (e.g.,
Python 3.12.x).
Essential Features
Section titled “Essential Features”Once configured, VS Code gives you superpowers:
- IntelliSense: As you type, VS Code suggests completions. Try typing
print(, and it will show you the arguments the function accepts. - Linting: If you make a syntax error (like forgetting a closing parenthesis), VS Code will underline it in red before you even run the code.
- Running Code: You can click the “Play” button in the top right corner to run your script in the integrated terminal.
Recommended Settings
Section titled “Recommended Settings”To make your code cleaner, we recommend enabling “Format on Save”.
- Open Settings (
Ctrl+,orCmd+,). - Search for “Format On Save”.
- Check the box.
- Search for “Default Formatter” and select “Python” (or “Black” / “Ruff” if you install those specific extensions).