Simple example script for flashing keyboard (like Logitech G810) leds (A-L). You need to copy correct version of LogitechLed.dll (found in Logitech installation directory - "Program Files\Logitech Gaming Software\SDK\LED(x86/x64)") in same directory as this script.
It seems that this requires Logitech Gaming Software running in background.