What you will need
To create Python programs you need a text editor to write your code and a Python interpreter which takes your code and runs it.
An editor, interpreter and other useful tools (such as a file browser) are often bundled together into an Integrated Development Environment (IDE), which makes the process of creating programs much easier.
You will be using an IDE to create, run and test your Python programs. You can install an IDE on your computer, or you can use an internet browser to access an online IDE. An installed IDE has the benefit of being able to work when you are not connected to the internet. On the other hand, an online editor doesn’t require anything to be installed.
There are three key areas to the Mu and Trinket IDE’s:
- Files: this is where all your programs will be stored. Each filename will end in
.pymeaning that the file is a Python file.
- Editor: this is where you will create your programs.
- REPL stands for “Read-Eval-Print Loop” (for reasons that will become clear). Your program will run in the REPL, which is where you will see any output and provide any input.
If you have permission to install software on your computer, I would recommend you download and install the IDE Mu.
If you can’t install software on your computer but can access the internet, you can use the online IDE Trinket.
Mu is available to download at the website codewith.mu where you will also find comprehensive installation instructions.
Here you will find easy to follow instructions to download, install and start Mu:
Linux users (other than Raspbian) should follow the Install with Python packaging instructions.
- When Mu starts for the first time, select the Python 3 mode and click OK.
If you experience problems or would just like to know more about Mu, have a look at Raspberry Pi’s Getting started with Mu guide.
Trinket can be accessed via any modern web browser at trinket.io.
- Open trinket.io and Sign Up for a free account or Log In if you already have an account.
- Complete the sign up form.