Python gpio-module to control GPIO via sysfs

Not sure this has been posted before (didn’t find it), there is a way to control GPIO with Python with sysfs-based gpio module:

Note: you require more memory to run pip, use the swap space guide posted here in this forum or create separate swapfile.

% cd gpio-1.0.0
% pip install .
% chmod +r /sys/class/gpio/export

then use this script blink.py:

import time

import gpio as GPIO

pin = 440
GPIO.setup(pin, GPIO.OUT)

while True:
    GPIO.output(pin, GPIO.HIGH)
    time.sleep(1.0)
    GPIO.output(pin, GPIO.LOW)
    time.sleep(1.0)

and run it:

% python blink.py