Keep the useful bits, human.
Beginner field notes
- In a shell with an installed command named python3, python3 hello.py starts that interpreter and gives it the saved source file hello.py.
- Python reads the file named by the command. Editing another tab, or leaving edits unsaved, does not change the source file it opens.
- If that file contains only print("Hello, human!"), the displayed result is Hello, human!. The saved source and the displayed result are different things.
See a worked example
Run the saved greeting
One reviewed sample, shared across levels. Nothing here runs on your computer.
Example review recorded 2026-10-07 · version 1.
python3 hello.pyHello, human!Assumptions: Python 3 is installed as python3, the shell is in the folder containing hello.py, and hello.py contains only print("Hello, human!"). On Windows with the Python launcher installed, use py -3 hello.py instead. The output ends with a newline.
Sources for this sampleVisual
The reviewed description and complete diagram source are available here.
More of this diagram is available inside its frame. Focus the frame and use the arrow keys to pan.
Read the complete diagram source
This is the source for the reviewed diagram, not a command to run.
flowchart LR
C["python3 hello.py"] --> I["Start installed interpreter"]
I --> F["Read saved hello.py"]
F --> O["Display greeting"] Full explanation and primary sources
Reviewed explanation
Suppose hello.py is saved in human-lab and contains print("Hello, human!"). From a shell working in that folder, a Python interpreter can read the file and evaluate that print() call. The command combines two things: the interpreter to start and the filename to give it.
The worked command assumes your installed Python 3 is available as python3. That name is common on macOS and Linux, but it is not universal and Python is not guaranteed to be installed. On Windows installations that provide the Python launcher, py -3 hello.py is an alternative for selecting Python 3. Use the command name supported by your installation; do not paste the shell prompt or a Python >>> prompt into the command.
If the shell cannot find the interpreter, address installation or command discovery first. If Python cannot open hello.py, check the working directory, complete filename, and saved location. If Python reports a syntax error, compare the source text with the example. These describe different failure stages; none is proof that you are bad at programming.
Running arbitrary downloaded code can have effects beyond printing a greeting. This example contains only a print() call, uses no credentials or network services, and does not modify your files. The lesson does not execute it automatically in your browser.
Source collection
- Python 3.13: Command line and environment
Used in: Quick notes
Script and module execution, whole-input parsing, script arguments, import-path initialization, -I, -P, -u and -v options.
- Visual Studio Code: Basic editing
Used in: Quick notes
Unsaved buffers, explicit and automatic saves, Hot Exit, format-on-save, indentation detection, encoding selection and comparison with saved files.
- Python 3.13: An Informal Introduction to Python
Used in: Quick notes · Worked example · Lesson text
Input and output prompt conventions, strings, print output and escape sequences.
The Python print() call’s displayed string result and prompt conventions.
- Python 3.13: Using the Python Interpreter
Used in: Worked example · Lesson text
Script execution from a filename, distinction from interactive mode, and installation-dependent interpreter names including the Windows launcher.
- POSIX.1-2024: pwd
Used in: Worked example · Lesson text
The working-directory path needed to interpret a simple relative script filename.
- Python 3.13: Using Python on Windows — Python Launcher
Used in: Worked example · Lesson text
The optional Windows launcher accepts -3 to select a core Python 3 installation; this is conditional on an installed launcher/interpreter, not a universal Windows command.
Notes AI source review · 2026-10-17
AI source comparison recorded 2026-10-07. Human learner validation is pending.
Quick quiz · one question
Find the stage that needs attention
Sample scenario. Synthetic POSIX-style environment. python3 is installed and discoverable. Only the listed saved script exists, and it is readable valid Python 3. There are no automatic directory changes, aliases, or network/file side effects. No command is actually executed.
- Available interpreter
python3 is installed and discoverable in this fixture- Current working directory
/human-lab- Saved file: /human-lab/notes/hello.py
print("Hello, human!")- Command to predict
python3 hello.py
The available interpreter is python3. Predict the command below: does it reach the saved greeting, fail to find the interpreter, or fail to find the requested script?
Why this answer?
Answers stay on this device.
Sources and exercise scope
- Python 3.13: Using the Python Interpreter
Interpreter command discovery depends on the installation; a supplied filename identifies the script read by the interpreter.
- POSIX.1-2024: pwd
Plain pwd reports the current working directory as an absolute path, followed by a newline.
Original synthetic exercise. AI comparison against primary documentation recorded on 2026-10-08; the references above state their scope. Human learner validation has not been run. A result here records this attempt; it does not establish mastery.
Follow this learning pathLesson 8 of 8
From project files to a small program
Save or adjust this lesson
Make this lesson yours
Save it for later, or tell your robot what would help.
This correction stays on this browser. Browse all concepts if the topic is missing.
Familiarity is your own assessment. To use it in your coding tool, download your updated learning profile.
Familiarity and lesson feedback are saved on this browser. They do not sync to your account or coding tool.