As mentioned python is deemed to be the ‘swiss army knife’ of programming and coding – I suppose it’s versatility is hard to contest. We can code anything from simple computer games to robots and weather stations . Letys have a look at a very simple introductory line of python code , this can easily be done in LX terminal on your Pi. Boot up your Raspberry Pi and logon as normal but do NOT start up Desktop – stay in terminal type in the following command (this creates a blank document called ‘hello world’) :
sudo nano helloworld.py
in your new document window type the following line:
print "Hello World"
then hit ⌃+ x to save ; answer yes and exit.
Now in terminal type the following code to run your 1st python program:
sudo python helloworld.py
Let’s do something a little bit more advanced in lesson number two.