
Here’s a tutorial how to AVOID bit-banging and use the hardware via C (while still in Python), shared by Louis Thiery in the Adafruit Forums. And here is the code in Github.
This implementation of SPI in Python is hardware based. Linux-level C code is compiled as a Python module. I first learned how to get SPI working on the Raspberry Pi with help from a tutorial by Brian Hensley. However, I love Python and I wanted to use this hardware implementation of SPI from within Python. I little searching told me that what I wanted to do was to “extend” Python with C and so this reference was very helpful.
Each Friday is PiDay here at Adafruit, be sure to check out our posts, tutorials and new Raspberry Pi related products. Have you tried the new “Adafruit Raspberry Pi Educational Linux Distro” ? It’s our tweaked distribution for teaching electronics using the Raspberry Pi. But wait, there’s more! Try our new Raspberry Pi WebIDE! The easiest way to learn programming on a Raspberry Pi.
Want a FREE RASPBERRY PI? All orders over $350 get a FREE Raspberry Pi Model B with 512MB RAM!

Printable catalog (PDF)
FEED
A little confused, how is this different from the SPI support that is already in occidentalis?
Comment by Adam Haile — January 11, 2013 @ 9:27 am
There is a Python module for SPI called py-spidev. https://github.com/doceme/py-spidev
I found it a few weeks ago when I was writing the Gertboard test suite in Python. IIRC it was Jeremy Blythe’s blog where I first heard about it.
Not much documentation though, but I managed to get it working.
Comment by Alex Eames — January 11, 2013 @ 5:30 pm
Oh – this tutorial is supposed to explain how to NOT bit-bang SPI in Python…
I didn’t know about the py-spidev before I wrote my library. It pretty much lines up exactly with what I did
Comment by Louis Thiery — January 11, 2013 @ 8:11 pm