I installed and configured Lirc on my Raspi, then I installed python-lirc. The Lirc configuration is OK, as I can use irw and irsend with no problem.

In my python program, when I try to read any IR code sent by my remote, the lirc.nextcode() function always return an empty list. The code is:

while (True):
            list = lirc.nextcode()
            if len(list) != 0: print "match!"
    except KeyboardInterrupt:

Also tried with pylirc library and have the same problem. Any idea? Thanks!

1 Answer 1


This seems unanswered elsewhere as well. 'lirc.nextcode() gives [] instead of key'

Your python script presumably has something like this before the lines you show?


Try adding the path of the .lircrc to the second init param:


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.