This is a pre-release of my raspberrypi python module that allows easy access to some information regarding your RPi. When desining it I was thinking about AmigaOS module available on AmigaOS 4.x platform and decided that RPi needs one dedicated module too.
Currently it targets Raspbian wheezy with 2.x Python installed.
Unpack the attached archive:
Code: Select all
bzip2 -cd ./raspberrypi-python.tar.bz2 | tar xvf -
Here is a peek into one of samples:
Code: Select all
import sys
try:
import raspberrypi
except ImportError:
print 'You need to install raspberrypi module first to run this sample code.'
sys.exit(1)
print 'CPU :', raspberrypi.cpu
print 'Hardawre :', raspberrypi.hardware
print 'Revision :', raspberrypi.hw_rev
print 'Serial :', raspberrypi.hw_serial
print 'MAC addr :', raspberrypi.MAC
print 'GPIO :', raspberrypi.isgpio
print 'WiringPi :', raspberrypi.iswiringpi
Additionally the archive contains one C source file that can help get you started with setting up your Python environment if you are new to it. Compile it like this:
Code: Select all
gcc -o rpi-install-python.exe ./rpi-install-python.c

Please let me know if anyone finds it useful or buggy.