Installing Python on Windows 11
Note: Any reasonably recent version of Python is acceptable for this course. If you already have Python 3.x on your computer, you can use it for this class.
If you don't have Python installed, download it from:
https://www.python.org/download/
Installing a Programming Text Editor
If you have a programmer editor you like, you can use it. If not, we recommend these free text editors for software development:
- Thonny – Free, open source, simple
- Phoenix Code – Free, open source, more advanced
- VS Code – Free, feature-rich, includes AI assistance
Writing a Python Program on Windows 11
We have a short step-by-step video showing how to install Python and write your first program.
Windows Command Line Notes
When the command line starts up, you are in your "home" directory. The path to your home directory varies by Windows version. In the examples below, replace csev with your own username.
Windows 10: C:\Users\csev
Windows 10 OneDrive: C:\Users\csev\OneDrive
Windows 11: C:\Users\csev
Windows 11 OneDrive: C:\Users\csev\OneDrive
The command prompt usually shows your current location in the folder structure.
To see exactly where you are, run cd with no parameters:
C:\Users\csev> cd
C:\Users\csev
Navigating Folders
When you open a command line, the first step is usually to move to the right folder. For example, to run a file from your desktop, use cd Desktop (or cd OneDrive\Desktop). Use dir to list files in the current directory and cd .. to go up one directory.
Tip: When typing a path, you can type part of a folder name (like Desktop) and press Tab to auto-complete it, as long as you've typed enough for the system to guess correctly.
If You Get Lost
If you lose track of your location or can't find the folder you need, close the Command Line or Terminal window and open a new one. You'll start back in your home directory.
Command Line Settings
Click the icon in the upper-left of the command prompt window and select Preferences. You can customize various settings; a particularly useful one is to set the Command History Buffer Size to 999, so you can scroll back through many previous commands.
Running Your Python Program in the Command Line
To run your program, type at the command prompt:
py firstprog.py
Or simply:
firstprog.py
Replace firstprog.py with the name of your Python file. Make sure you're in the correct directory using the cd command first.
You can run your program repeatedly in the same command window. Use the up-arrow key to recall previous commands and press Enter to run them again—handy when you're editing and testing changes.
Copyright Creative Commons Attribution 4.0 - Charles R. Severance