hdr = '\x00' * 4
blocksize = 51
leds = hdr + '\x80\x00' * blocksize, hdr + '\xff\xff' * blocksize
fname = '/dev/stdout'
with open(fname, 'wb') as f:
    pass
Send HEX values to SPI on a Raspberry PI B+