pylibftdi / pylibftdi / examples /

Report connected FTDI devices. This may be useful in obtaining
serial numbers to use as the device_id parameter of the Device()
constructor to communicate with a specific device when more than
one is present.

example usage:

    $ python pylibftdi/examples/
    FTDI:UM232R USB <-> Serial:FTE4FFVQ

To open a device specifically to communicate with the second of
these devices, the following would be used:

    >>> from pylibftdi import Device
    >>> dev = Device(device_id="FTE4FFVQ")

Copyright (c) 2011-2013 Ben Bass <>
All rights reserved.

from pylibftdi import Driver

def get_ftdi_device_list():
    return a list of lines, each a colon-separated
    vendor:product:serial summary of detected devices
    dev_list = []
    for device in Driver().list_devices():
        # list_devices returns bytes rather than strings
        device = map(lambda x: x.decode('latin1'), device)
        # device must always be this triple
        vendor, product, serial = device
        dev_list.append("%s:%s:%s" % (vendor, product, serial))
    return dev_list

if __name__ == '__main__':
    for device in get_ftdi_device_list():