Trying out Python Examples


#1

Hi I have only just got my first Pi so sorry if this is a really obvious question.
I have got a Scroll Bot, soldered it all up and set it up for headless mode, including adding the python library’s.
but I cant figure out how to try the examples like “Swirl” when I try copy and pasting the code into my Pi Zero it wont work and throws up errors

saying IndentationError…like I say this is probably really obvious thing, and I’m sorry if it is (I have had my Pi 3 Days. lol and I’m stuck)

if anyone can point me to a tutorial how to copy code into the Pi using Putty I would appreciate it.

Thanks

Nick


#2

You should fire up nano: nano somefile.py and paste the code into somefile.py, save, and then run that file with python somefile.py. Pasting a whole code example right into the Python REPL will have… unpredictable results :D It’s just not intended for that.


#3

that’s great thanks. got swirl working…now what to try next. lol