Lesson Notes — Setting Up IDEs & Development Environments (CodeHS, W3Schools, Python IDLE)
Course 3: Introduction to Programming / Unit 1: What Is Programming & Program Development Life Cycle (PDLC) / Lesson 3: Setting Up IDEs & Development Environments (CodeHS, W3Schools, Python IDLE)
Lesson overview
Programmers write code in a special workspace called an IDE, or Integrated Development Environment. An IDE puts the tools you need in one window so you can write, run, and fix your code without switching programs.
What is inside an IDE
- Code editor: where you type your code.
- Syntax highlighting: colors that mark keywords, text, and numbers so mistakes are easier to spot.
- Console: the area that shows your program’s output and any error messages.
- Run button: starts the execution of your program.
- Debugger: a tool that lets you pause a program and look at it step by step to find bugs.
A plain text editor only lets you type. An IDE adds tools to run and debug as well. For languages like Java or C++, an IDE can also include a compiler. For Python, an interpreter does that job. Your workspace is the set of files and settings you are working in.
Three places to write Python
- CodeHS: an online IDE that runs in your browser. You write code and click Run.
- W3Schools: a website with Python lessons and a “Try it Yourself” editor for quick experiments.
- Python IDLE: a simple IDE that comes with Python when it is installed on a computer.
Your first program
print("Hello, World!")
- Open a new file or editor window.
- Type the line exactly as shown, including the parentheses and quotation marks.
- Save the file with a clear name that ends in
.py, such ashello_world.py. The file extension.pytells the computer it is a Python file. - Run it. In CodeHS or W3Schools, click Run. In IDLE, choose Run, then Run Module, or press F5.
- Look at the console. You should see
Hello, World!
File saving habits
- Save before you run, and save often.
- Use lowercase names with underscores instead of spaces, such as
hello_world.py. - End every Python file with
.py. - Save in the folder or drive your teacher tells you to use.
Common beginner errors
| What you typed | What happens | Why |
|---|---|---|
Print("Hello") |
NameError | Python is case sensitive, so print must be lowercase. |
print("Hello) |
SyntaxError | The closing quotation mark is missing. |
print(Hello) |
NameError | Without quotation marks, Python thinks Hello is a name it should already know. |
The last line of an error message usually names the problem, and the line number above it tells you where to look.
Check your understanding
- Name three features an IDE gives you that a plain text editor does not.
- Why does a Python file name end in
.py? - You run your program and see a SyntaxError. Where do you look first?
Use the Key Terms page for this lesson to build your glossary, and write each definition in your own words.