# 3. Writing your own programs using IDLE

We have done some python, now it is time to use it outside of this book. We will return to using the book again later.

## 3.1. Big Question

- What is idle?
- How do I use it?

## 3.2. What is IDLE? (1)

Idle is
  - a text editor: you can type in code, and save it, but you can not format the text (like in word).
  - a place to run your python code. After typing in python code. You can run it.

Discuss with a partner, what you think this means.

## 3.3. Starting Python IDLE (2)

Idle is a program on you computer. If you are using Microsoft’s Windows 10 then follow the steps bellow.

First click the start menu then click `Python IDLE` it is under P for Python.

A window like this will appear (but a bit bigger).

## 3.4. Open a new file (3).

This is where you will type your work.

Go to file → newfile

A new window will appear.

## 3.5. Type some code into python (4)

Type a program into this new window. In the picture I have started a program. Don’t write more than these 3 lines before running the program.

## 3.6. Save the program (5)

First save the program, insure that you give it a good name.

## 3.7. Run your program (6)

To run the program press

## 3.8. Practice (7)

Now try writing a small program (such as one to draw a square). Run it several times, by pressing F5, as you are writing it. You should find the process similar to what you have already done in this book. But now you can save your work on your computer.

## 3.9. Load a program into IDLE (8)

It is ok saving stuff, but if you can not load it again letter, then it will be for nothing.

To load a program into IDLE:
  - In file-explorer, right click on the file.
  - Select Edit in Idle.

Next Section - 4. Iteration Challenges