Skip to main content

Python bindings for LIRC.

Project description


LIRC extension written in Cython for Python 3 (and 2).


You'll need to have [lirc configured](
and you may need to install cython (`aptitude install cython gcc`):

Download, compile and install for Python 3 and 2.

git clone
cd python-lirc/
make py3
sudo python3 install
make py2
sudo python install

Or just install straight from PyPI:

sudo easy_install3 python-lirc
sudo easy_install python-lirc


You need a valid [lircrc configuration file]( For example:

$ cat ~/.lircrc
button = 1 # what button is pressed on the remote
prog = myprogram # program to handle this command
config = one, horse # configs are given to program as list

button = 2
prog = myprogram
config = two


$ python3
>>> import lirc
>>> sockid = lirc.init("myprogram")
>>> lirc.nextcode() # press 1 on remote after this
['one', 'horse']
>>> lirc.deinit()

Load custom configurations with:

>>> sockid = lirc.init("myprogram", "mylircrc")
>>> lirc.load_config_file("another-config-file") # subsequent configs

Set whether nextcode blocks or not with:

>>> sockid = lirc.init("myprogram", blocking=False)
>>> lirc.set_blocking(True, sockid) # or thisChange Log

- Tidied up project structure.
- init now tries to use config at ~/.lircrc and then /etc/lirc/lircrc.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for python-lirc, version 1.1
Filename, size File type Python version Upload date Hashes
Filename, size python-lirc-1.1.linux-armv6l.tar.gz (49.1 kB) File type Dumb Binary Python version 3.2 Upload date Hashes View
Filename, size python-lirc-1.1.linux-x86_64.tar.gz (60.3 kB) File type Dumb Binary Python version 3.2 Upload date Hashes View
Filename, size python-lirc-1.1.tar.gz (25.5 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page