# How to run Python files

There are three ways to run Python files:

1. Using Code Runner
2. Using Terminal
3. Using IDLE
4. In our website (trinket)

## 1. Code Runner

Writing code and pressing the traingle button will run the code.

However, you cannot type in the code directly.

So, most of the time, you would need to use the Terminal.

```py
print("hello world")
```

![Result](/img/python/run/code_runner_hello_world.png)

## 2. Terminal

Terminal is a space for typing commands and running them.

Running the code below will run the `hello.py` file.

```sh
python hello.py
```

To open the terminal, follow one of the steps below.

1. Press `` ctrl + ` `` (press `ctrl` with `)
2. Terminal > New Terminal

![Terminal](/img/python/run/new_terminal.png)

![Result](/img/python/run/result_hello_terminal.png)

## 3. IDLE

If you have enabled the 'IDLE' option while installing, you can run python code in the IDLE.

Search for IDLE or double click on one of the shortcuts.

![IDLE](/img/python/run/idle_hello_world.png)

Typing `print("Hello World")` and pressing entering will print the result.

## 4. Trinket (coding-insight.com)

Our site uses the [Trinket](https://trinket.io) to run Python code.

<iframe
  loading="lazy"
  title="Python IDLE Trinket"
  src="https://trinket.io/embed/python3/93a3b5a1dc"
  height="400"
/>
