top | item 27502298

I teach Python on the Raspberry Pi 400 at the public library

337 points| feross | 4 years ago |opensource.com | reply

84 comments

order
[+] int_19h|4 years ago|reply
Nice to see turtle graphics mentioned in this context. Back when I learned to code, it was one of the more common teaching techniques, and I still believe that it's one of the most "hands on" ways to explain loops, recursion etc.

As far as development environments - have you tried Thonny (https://thonny.org/)? It has some nice features in it that are specifically geared towards explaining how things work. For example, when you debug, you can step through subexpressions, and their values are automatically substituted in the editor as they are computed.

[+] curryst|4 years ago|reply
I might be odd here, but my intro to Python was with turtle graphics and I despised it. My spatial sense is rather poor, and having to translate between code and Cartesian coordinates and vice versa was a heavy mental overhead.

    for x in range(0, 10):
        print(x)
Is way clearer to me than having to draw circles or lines and then manually calculating the Cartesian coordinates I should have hit to make sure it's actually doing what I want.

Likewise with pretty much all of the constructs. It's easy to understand a function that sums a list of ints, and it's easy to check. It's much harder for me to grok and check a function that draws circles at a list of Cartesian coordinates. A recursive Fibonacci sequence is easy for me to grok; just have it print out the values it's using at each loop. A recursive function to draw fractals is going to take me forever to figure out what recursion is actually doing. I can see that it changes, but figuring out how/why or why I would ever want to use it is really difficult.

I think it's just too much of an abstraction for me. Code -> numbers -> coordinates -> image is too many indirections for me to follow. When I wanted something "hands on", I usually defaulted to consuming APIs. It's really not much harder to install a Reddit API client and use it. It gives me something I can check, it's something I would actually want to do, and it's practically infinitely extensible.

[+] sleepybrett|4 years ago|reply
Back in the 80s I took a summer school class offered by the district in 'computer programming' which was about half logo half applesoft basic. The school even had a little 'turtlebot' driving pen plotter bot, tethered to one of the //e's by what I assume was a serial cable.

If your logo program was particularly cool the teacher would print your program out on the little dot matrix printer and project it up on a screen using an opaque projector and step through it line by line while the little robot drew it out on a piece of butcher paper.

Probably one of the early experiences that made me love pen plotters.

[+] StavrosK|4 years ago|reply
Thonny looks great, thanks for the tip! I've had friends who had trouble understanding how return values work, this would help!
[+] amatecha|4 years ago|reply
FWIW if you are operating on an extremely small budget and want to do something like this, you can definitely hit up your local thrift shops (or craigslist) for very cheap used monitors. I know that doesn't get you the Pi systems, but new monitors can be quite pricy.
[+] ChrisRR|4 years ago|reply
FWIW you can probably find a hell of a lot ex office PCs for free

I do admire the raspberry pi project for their work, but for just programming simple python projects, any 15 year old core 2 duo will work and people can't get rid of them fast enough

[+] Pxtl|4 years ago|reply
Off lease refurbishers generally have old 1440x900 monitors in bulk, although in COVID world they're pretty picked over as everybody working remote has grabbed one or two.
[+] jll29|4 years ago|reply
Great post. And kudos to the groundbreaking work by Eben Upton and others in Cambridge, for giving the Raspberry PI to us so this kind of effort can now happen anywhere in the world at minimum cost.

PyTurtle is a great library for educational use - I used it to teach 11-year-olds in Scotland how to draw a house. The approach take was: instruct pupils to draw a house on paper, using only straight lines; teach them briefly what a coordinate system is (assigning numeric addresses - pairs of numbers - to points), which they haven't had in their maths curriculum at that stage, but which they easily picked up; translate the paper-based house into a sequence of PyTurtle Python commands.

[+] mathgenius|4 years ago|reply
But turtles do not use coordinates, if anything they use (relative) polar coordinates ... Oh, maybe you first coordinatize the house drawing and then make turtle commands from that? It seems that turtle programs don't need any mathematical priming....
[+] pjmlp|4 years ago|reply
While the achievements on PI cannot be denied, BeagleBoard happened in 2008, Panda Board appeared in 2010, while PI exists since 2012.
[+] TaylorAlexander|4 years ago|reply
Really great efforts and I appreciate the write up!

If anyone here wants to think more about how to teach computers to children, I highly recommend this video with Seymour Papert, creator of the LOGO programming language and origin of the turtle concept.

https://youtu.be/ZG9cYhekB8A

The complete video series is available here: https://el.media.mit.edu/logo-foundation/resources/onlogo/in...

[+] ivansavz|4 years ago|reply
Another good video about technology in education in general. It's old but, insights are timeless.

[ 1995 Technology In Education hearing featuring Seymour Papert and Alan Kay hearing on education ]

https://www.youtube.com/watch?v=0CKGsJRoKKs

[+] one_off_comment|4 years ago|reply
I'd love a list of the materials the author is using for their standard work stations. I'm particularly curious about the "inline power adapters". I see in one of the pictures each one has a little black brick. Looks like maybe a USB hub or something? The Raspberry Pi 400 already has 3 USB ports.

I'm speaking as a daily Raspberry Pi 400 user. I've tried one of those USB hub things with power pass-through that I use for my Mac Book Pro, but it didn't work with my RPi400.

Always up for hardware tips for improving my Pi situation.

[+] pgroves|4 years ago|reply
The nice thing about programming on a RaspberryPI is that the only websites that are light enough to use are Google, Stackoverflow, Github, ReadTheDocs, etc. If you try to check Reddit/Twitter/Facebook you get frustrated with how slow they are and go back to the text editor.
[+] 1-6|4 years ago|reply
I get your point but I recently bought a RPI with 8GB RAM. Although it is in no way comparable to a modern Celeron or Pentium, SBC's are already to the point where they can sufficiently be used for web browsing.
[+] cochne|4 years ago|reply
I wanted to do something similar! I messaged my local library with a small proposal, but they never got back to me, very disappointing.
[+] nednar|4 years ago|reply
> I messaged my local library

Suggestion: Talk to the people face-to-face, and have a demo ready. If you tell them you want to do something for kids, in the demo there are free cookies, and besides offering the space they don't have to do anything, then the chance is almost 100% that they jump in.

PS: Some more traditional organizations don't even read their emails at all. So don't take it personally.

[+] epmaybe|4 years ago|reply
Does anyone have a good recommendation for ‘relearning’ basic programming practices when you don’t have much free time? I code every now and then but my workflow for coding/debugging is terrible now that I’ve essentially forgotten basic concepts like stacks, breakpoints, unit tests, etc. embarrassed to say I use print commands far too often.
[+] oatflatwhite|4 years ago|reply
There is no need to be embarrassed about using print commands for debugging. Tried and true method for many decades.

Suggestion: find a problem you want to solve, some small project or fun hack. And just do it. Every time you get stuck, go to google and search for the answer. Spend time looking at multiple responses and take your time rabbit holing and viewing tangential information. The important part is starting the project.

[+] wirthjason|4 years ago|reply
I don’t know the context of your situation but use an IDE with an graphical debugger. Eg. PyCharm. Then you can easily enter a breakpoint and inspect your code, move up and down the stack to see how you arrived at the point, etc.
[+] cjohnson318|4 years ago|reply
Does anyone have thoughts on starting kids on manipulating CSVs or xlrd, instead of turtle?

I was exposed to turtle graphics in school when I was a kid, but I wasn't impressed. I thought there was a huge gulf between turtle graphics and actual programming. It wasn't until 20 years later that I realized there wasn't a huge gulf, I was just one module away from doing real things. When I figured out how to process data, and do useful things, it blew my mind.

[+] cushychicken|4 years ago|reply
>I was exposed to turtle graphics in school when I was a kid, but I wasn't impressed

I think most kids would say the same thing about manipulating spreadsheets.

I would have. Spreadsheets are fucking boring. Hell, I still think spreadsheets are fucking boring.

The only reason that modifying spreadsheets is exciting to me is because of how much time automating the modifications saves me.

[+] themodelplumber|4 years ago|reply
I didn't expect to see it was self-funded. I wonder if that was done in anticipation of red tape, or something else? Anyhow, way to go Don!
[+] jennasys|4 years ago|reply
It sounded like the purchase of the 5 Pi400s ended up being covered by the library system, but the guy teaching still provided his time and curriculum. I'd imagine getting budget approval for $500 in hardware is a lot easier than getting it for labor. It's good that the library had people there willing to work the system to help make this happen.
[+] fridif|4 years ago|reply
Nice to be teaching students programming for free.

One potential cost optimization is to teach them using pen and paper, visually, especially since "their keyboard skills were rough".

[+] qiqitori|4 years ago|reply
I'm by no means an experienced teacher, but I think the hands-on approach is the way to go for programming...
[+] lostmsu|4 years ago|reply
If Pi was chosen for its price, there are quite a few laptops on Ebay, that would have been much cheaper.
[+] _ph_|4 years ago|reply
The value of the Pi is, that it is affordable brand-new. You can buy one or as many as you want and be sure that they are in a perfect working state, no repairs or special set up required. Just having identically machines is of extreme high value, if you are looking not only for a personal item, but something you can rely on for some kind of professional work.

Another nice thing is, that the Pi can boot and work solely on a single micro-SD card. That makes it easy to have any number of install "disks" ready at hand, you don't have to set up the systems hard disk first.

Finally, the Pi gives you a nice set of IO-ports, you can immediately start with any hardware tinkering project.

[+] lvturner|4 years ago|reply
Likely, as it was the library that bought them they had to buy via a pre-vetted supplier. Also, if you bought from eBay I'd be quite surprised if your overall time costs didn't multiply. There's something to be said for the Pi's ability to work right out the box without having to do any additional OS configuration.
[+] codetrotter|4 years ago|reply
The Pi also has the advantage of having a huge huge community, so any of the people learning from this person and deciding to get a Pi of their own will be able to find a lot of help online while they are experimenting with the Pi at home
[+] Cthulhu_|4 years ago|reply
You get what you pay for though, you don't need to spend hours cleaning up someone else's grubby old laptop, and it's a consistent and open source system.
[+] abdullahkhalids|4 years ago|reply
The advantage of giving a "toy computer" to a kid is that parents will not freak out if the kid tinkers with it. If a 10 year old opens their laptop, even a cheap one, a lot of parents will freak out.
[+] einpoklum|4 years ago|reply
> At the end of the four-day course, each student received a Raspberry Pi 400

So, the number of participants was limited to 5?

I don't know, that sounds a bit problematic. I would have opted for helping students set up a Python environment on their PCs or laptops (and maybe kept the RPi's to students who may not have one; although identifying students in this situation may be tricky)

[+] noir_lord|4 years ago|reply
> I would have opted for helping students set up a Python environment on their PCs or laptops

You assume that students have a PC or laptop particularly one they can do whatever they want on and that even if they do parents are happy with them installing development tooling on the laptop.

[+] matthewowen|4 years ago|reply
Well, why don't you go ahead and do it that way when you decide to run one of these courses?
[+] 1-6|4 years ago|reply
It seems like giving out RPi's seem like the perfect reward. It's tangible and it helps keep environments separate versus a Windows or Mac laptop. Kids can take risks on the RPi by breaking things which is a good learning technique.