Which language on the Raspberry Pi?

What language should you use on the Raspberry Pi? There is quite a choice, including Python, Scratch, Java, C, Julia, and that's not counting the web stuff like Javascript, Html and Php.
There is no definitive answer - it depends on what you want to do. If you are teaching a child the basics of programming then Scratch might be a good choice. If you are an older learner then you might go for Python or Java with Greenfoot.
If you are interested in programming the Raspberry Pi hardware then there are libraries for pretty much any language that will let you do that. 
If you want a graphical user interface then you may want to give C a miss. But not necessarily because you can tack on a GUI in almost any language these days.
So where does that leave us?
Here is a list of some of the programming languages available for the Raspberry Pi with my brief personal notes and an example program for each one (except Scratch).

Scratch This is a graphical language designed to teach kids about p…

Just Enough Python

Just Enough Python

This is a series of tutorials to get you going with Python on your Raspberry Pi (or other Linux system) . It is NOT a comprehensive guide to Python but  teaches you enough to be able to give you a flavour of the language and to produce useful programs.

Just Enough Python 0 - getting set up

If you are using a Raspberry Pi to follow this tutorial and you have the latest version of Raspbian, then you already have everything you need. If you are using something else, read this first.  (Go there now)

Just Enough Python with Geany 1

Python is a great language to learn, as well as being a real professional's language. It is include in Raspbian the Pi's operation system. Here we see how to use the powerful but light-weight editor, Geany, to create and run a Python program. (Go to Just Enough Python with Geany 1)

Just Enough Python 2

Now we know how to use Geany, we are going to write a simple program that takes and input from the keyboard, changes it a little, and writes back out to the screen. In this simple program we also learn about different types of data and variables. But first we need to tell Geany that we are going to use Python3. (Go to Just Enough Python 2)

Just Enough Python 3

This time we are going to look at how to make decisions in Python and while weare doing that we'll also see how to use Python libraries. (Go to Just Enough Python 3)

Just Enough Python 4 - Repeating yourself

This lesson introduces the concept of loops, or repetion, and demonsrates a simple guessing game in Python. (Go to Just Enough Python 4 - Repeating yourself)

Just Enough Python 5 - Repeating yourself, again

A different type of loop this time which allows us to put a little more sophistication into our guessing game. (Go to Just Enough Python 5 - Repeating yourself, again)

Just Enough Python 6 - a simple GUI

We install a very simple GUI package and create a simple windows-like program. (Go to Just Enough Python 6 - a simple GUI)

Just Enough Python 7 - buttons and text boxes

We create a GUI for the guessing game and find out how to define a function. ( Go to Just Enough Python 7 - buttons and text boxes)

Just Enough Python 8 - a working GUI version of the  guessing game

We use the GUI that we created last time but properly define the function that is invoked when we press a button. (Go to Just Enough Python 8 - a working GUI version of the  guessing game)

Just Enough Python 9 - a properly working game

We enhance our guessing game with a dialog box and make it work properly. Once you've guessed the right answer it asks you if you want to play again. (Go to Just Enough Python 9 - a properly working game)

Start with lesson 0  (if you need to set up your computer)

or lesson 1 (if you are already set up)

Running Python programs on the Raspberry Pi

I've shown you how to create and run programs using Geany but you can run them from the command line, too.  Here's a tutorial on how to do that and, as a bonus, the Idle IDE is introduced, too. (Thanks to Dominic Bolding.)

Intermediate level Python tutorials

For these tutorials we assume a familiarity with Python and the Raspian operating system


Flask is a framework that lets you create dynamic web pages using HTML and Python. While these tutorials are aimed at Raspberry Pi users they are also applicable to Python users on almost any Linux  platform.

Use Flask to put your Pi sensor data on the net - part 1
This tutorial introduces Flask and shows how to create a simple Flask program in Python.

The second part of the tutorial introduces Flask templates and shows how to create a dynamic web page- The example given can be used to display images from a webcam.


Popular posts from this blog

Learn to code with C

Introduction to Python by Andrew Ng