post icon

How to run Python program on Raspberry Pi LXTerminal

If you are new to using Python on the Raspberry Pi, this article may help you.
First of all, let’s create a simple Python program directly from RPi module, using LeafPad text editor provisioned out of the box with Raspbian operating system.
Therefore, let’s open LeafPad, past the following Python program code snippet:

import datetime

dt =

print str(dt) 

and save the fine on Desktop with name

Now open Raspbian terminal LXTerminal and type the following command to reach the Desktop folder:

cd /home/pi/Desktop

Next, type the following command to run DateTimeProgram Python program and type Enter key:


The program should now be running and print the dae and time on the output console.


Leave a comment
  1. emiliano
    November 30th, 2015 at 10:26 #

    un altro modo è quello di aggiungere al file, nella prima linea, lo shabang

    dare i diritti di esecuzione al file con

    chmod +x

    ed infine eseguire direttamente il file, sempre dalla dir Desktop,


Leave a Reply

Are you human? Time limit is exhausted. Please reload CAPTCHA.