Introduction
In this chapter, we shall jump into using Python to perform some basic encryption by scrambling letters. This will introduce some basic string manipulation, user input, progressing on to creating reusable modules, and finally graphical user interfaces.
To follow, we shall create some useful Python scripts that can be added to run as the Raspberry Pi boots or as an easy-to-run command that will provide quick shortcuts to common or frequently used commands. Taking this further, we shall make use of threading to run multiple tasks and introduce classes to define multiple objects.
Since it is traditional to start any programming exercise with a Hello World example, we shall kick off with that now.
Create the hellopi.py
file using nano
as follows:
nano -c hellopi.py
Within our hellopi.py
file, add the following code:
#!/usr/bin/python #hellopi.py print ("Hello Raspberry Pi")
When done, save and exit (Ctrl + X, Y, and Enter). To run the file, use the following command:
python3 hellopi...