Install and Run Python
Learn the basic tools you need to run Python locally.
Before learning syntax, you need a repeatable way to execute code and see the result.
Start with the idea
The simplest workflow is: install a current Python 3 release, open a terminal, verify the installation, create a .py file, and run it with the Python command available on your system.
Small working example
Run this example first. Do not change several things at once; confirm the basic behavior, then experiment.
python --version
python hello.py The simplest workflow is: install a current Python 3 release, open a terminal, verify the installation, create a .py file, and run it with the Python command available on your system.
- Use Python 3.
- Verify the interpreter version.
- Run files from the terminal to build confidence with the basic workflow.
Python 3.x.x
Hello, Python!The example is intentionally small. Focus on the chapter’s main idea before adding extra syntax or framework code.
Common beginner mistake
Editing code without checking which Python installation your terminal is using.
Verify the version first. If your system uses python3 instead of python, use that consistently in examples.
Quick recap
- Use Python 3.
- Verify the interpreter version.
- Run files from the terminal to build confidence with the basic workflow.
Try it yourself
These are deliberately small. If you can complete them without copying the example, you are ready to continue.
- Create hello.py and run it.
- Intentionally misspell the filename and read the error message.