0%

Your Own Machine, Your Own Editor

Open the Folder in an Editor

Double-clicking hello.py would open one file. Open the folder instead. The distinction is small on screen and large in practice: an editor opened on the project can show its other files, find .venv, and start a in the right working directory.

Any plain-text code editor that can open a folder and an integrated terminal is enough. This course uses Visual Studio Code for the concrete button names because it is available on , Windows, and . If you use another editor, use its Open Folder, Terminal, and Python-interpreter equivalents.

If no suitable editor is installed and you cannot install software on this computer, continue to the final lesson’s site-only path. A managed or shared computer is not a reason to work around its policy.

Open the project, then the file

If you need the editor, download Visual Studio Code for your and follow its installer. In its Extensions view, install Python published by Microsoft; this supplies the interpreter selection and Python run commands used next. The official Python tutorial shows the same setup.

In Visual Studio Code:

  1. Choose File → Open Folder….

  2. Select the extracted python-land-chapter-4 folder itself, not hello.py.

  3. If the editor asks whether you trust the folder, read the prompt and choose trust only for the project you just downloaded from Python Land.

  4. Select hello.py in the file .

  5. Choose Terminal → New Terminal.

The terminal panel should open at the project folder. Ask it instead of assuming:

pwd

The final path segment should be python-land-chapter-4.

If the path ends in Downloads or another parent directory, close that terminal and reopen the folder with File → Open Folder…. Do not compensate with a long in every later command. Fix the project boundary once.

The editor and terminal now look at the same folder. The next lesson gives that folder its replaceable Python environment.

Why open the folder rather than double-clicking hello.py?

Your editor terminal reports a path ending in Downloads. What should you do?