I recently just got my raspberry model b with sensehat addon. This is my first time using such programming devices as python and I don't get why there is always a syntax error.
I'm writing my command in Python 3 (IDLE), run it (working) for one time, save it as a .py file. When I try to run the command again, a pop-up showing invalid syntax appears and I can't run it again. The LED screen of the Sensehat is stuck at that moment and I have to rewrite the whole command to run it again for one time.. Does anybody know why this is happening?
Command:
Python 3.4.2 (default, Oct 19 2014, 13:31:11)
[GCC 4.9.1] on linux
Type "copyright", "credits" or "license()" for more information.
from sense_hat import SenseHat
from time import sleep
from random import randint
sense = SenseHat()
r = randint(0,255)
sense.show_letter("O", (r,0,0))
sleep(1)
r = randint(0,255)
sense.show_letter("M",(0,r,0))
sleep(1)
r = randint(0,255)
sense.show_letter("G",(0,0,r))
sleep(1)
sense.clear()