Tips for Working with Python and VS Code¶
VS Code Navigation¶
- Explorer (files): Use the Explorer icon on the left to browse files and folders.
- Open file quickly: Use
Ctrl+P(orCmd+P) to search and open a file by name. - Command Palette: Use
Ctrl+Shift+P(orCmd+Shift+P) to access any VS Code command.
VS Code Terminal Tips¶
- Use the terminal command
clearto clear output. - Use the UP ARROW key and DOWN ARROW key to scroll through past commands.
Find and Replace (in a file)¶
- Find:
Ctrl+F(orCmd+F) - Replace:
Ctrl+H(orCmd+H)
Find and Replace (across the whole project)¶
- Find in files:
Ctrl+Shift+F(orCmd+Shift+F) - Replace in files:
Ctrl+Shift+H(orCmd+Shift+H)
Global changes can have unintended consequences. Review changes carefully and prefer smaller, incremental edits.
Python Interpreter (Important)¶
If Python features do not behave correctly (linting, imports, type hints), the interpreter may not be set to the project environment.
- Open the Command Palette
- Select Python: Select Interpreter
- Choose the interpreter inside this project
.venvfolder - If things still look wrong, run Developer: Reload Window
Tip: The selected interpreter typically appears in the bottom status bar when a Python file is open.