def get_device_name(f): a = array.array('B', [0]*1024) fcntl.ioctl(f, HIDIOCGNAME(1024), a, True) print a