My Account

Wish List (0)

GPIO & Python (1/9) - Hello World

Written by in YouTube Workshop Kit on .

Run your first python program “hello world”

Things you will need:

Raspberry Pi + SD Card
Keyboard + Mouse
Monitor + HDMI Cable
Power Supply


Latest version of Rasbian installed on your SD Card
Raspberry Pi setup with a keyboard, mouse and monitor


1. Start by opening a Terminal, by click the icon in the taskbar

2. Start by creating a new directory, this is where we are going to store all our scripts for this series of tutorials, make a directory called gpio_python_code:

 mkdir gpio_python_code

3. We can use the command ls -l to view the contents of the current directory:

 ls -l

You should be able to see the directory you created

4. Now we need to change our current directory to the newly created gpio_python_code directory:

 cd gpio_python_code

5. Using the touch command, we can create an empty file. This will be where we are going to code our Hello World script.


6. Once we have created our empty file, we can use the command nano, to open it in a text editor.


7. Now enter the following code:

#Print Hello world
print "Hello World!"

8. Press ctrl+X to exit, you will be prompted to save the file, simply press Y, and then be you will be prompted to give the file a name.
It will automatically use its current name, so just hit enter to accept.

9. To execute your script, simply enter the following command:

 sudo python

Last update: Feb 22, 2017


Leave a Comment

Leave a Reply

The product is currently Out-of-Stock. Enter your email address below and we will notify you as soon as the product is available.