diy.laser
Posts: 2
Joined: Mon Dec 16, 2013 10:00 am
Location: Netherlands

WiringPi

Tue Mar 11, 2014 12:05 pm

I use python and windows 7 to write little program and test them for me RPI.
For GPIO, I use the WiringPi libraries and that works fine on RPI.
But does not "RUN" within windows/python.

How do I use "WiringPi" with Python and let it run under Windows in order to test whether the program made ​​does what I figured.

What should I do so that python can find the libraries ?

User avatar
elParaguayo
Posts: 1943
Joined: Wed May 16, 2012 12:46 pm
Location: London, UK

Re: WiringPi

Tue Mar 11, 2014 12:28 pm

I'm not familiar with WiringPi but I can tell you what I do in a similar situation. I create a stub module, that is a module that has the same classes, methods and constants as the module I need, but the classes and methods are empty. This stops my script from throwing errors related to an unavailable module and lets me debug the rest of my code.

For example, xbmc python modules are only available within xbmc, however you can uses stubs (like this) to write scripts outside of xbmc.

The downside is that you obviously lose some of the key functionality that you want your scripts to have.

Don't know if this is relevant for WiringPi or not however I have used this for RPi.GPIO when I was testing a script on another machine and didn't want to comment out all the GPIO related lines.
RPi Information Screen: plugin based system for displaying weather, travel information, football scores etc.

Return to “Python”