Python Programming from First Principles: Learn to Code, Think Computationally, and Solve Real-World Problems
PDFEPUB
CHAPTER GUIDE · GETTING STARTED

Creating projects

On this pageCreate the practice folderOpen the folder in VS CodeSelect Python

A project folder keeps the files for one piece of work together. This first project needs only a folder and a Python file. More elaborate project layouts can wait until a program needs them.

Create the practice folder

  1. Open File Explorer on Windows, Finder on macOS or the file manager on Linux.
  2. Choose a location where you can save your work, such as Documents.
  3. Create a new folder: right-click an empty area and choose New → Folder on Windows; use File → New Folder on macOS; or use the file manager’s New Folder command on Linux.
  4. Name it first-python-file-demo and press Enter. Leave it empty for now.

Open the folder in VS Code

  1. In VS Code, choose File → Open Folder… on Windows/Linux or File → Open… on macOS.
  2. Select first-python-file-demo and open it.
  3. If a Workspace Trust question appears, trust this folder only if it contains your own practice files. This permits the editor to run the code you place there.
  4. Select Explorer in the left activity bar. The folder’s name should appear above its files. If the area is empty, the folder is open and ready for its first file.

The open folder is the project’s workspace: the area whose files and settings VS Code manages together. No separate workspace file is needed for this example.1

Select Python

  1. Open View → Command Palette… or press Ctrl+Shift+P on Windows/Linux or Command+Shift+P on macOS. The palette is a searchable list of editor commands.
  2. Type Python: Select Interpreter and choose that command.
  3. Select the Python environment verified during installation. For this book’s Anaconda route, choose its base environment; inspect the displayed path if several environments have similar names.
  4. If the environment is missing, restart VS Code after completing Python installation. Reopen the palette and try again.2
Official VS Code interpreter list showing a Conda base environment alongside Global and Workspace environments, with generic example paths.
Figure 7 — The interpreter selector lists available Python installations. For the Anaconda route choose the Conda base entry, rather than copying the screenshot’s highlighted Global selection. Paths and release numbers vary.

The folder now holds the project’s files, and VS Code knows which Python should execute them. Creating hello.py turns this empty workspace into a runnable program.


  1. Microsoft, Workspaces and Workspace Trust.↩︎

  2. Microsoft, Python environments. Source of the interpreter selector screenshot. Checked on 22 October 2026.↩︎