import os, struct, fcntl RANDOM_READ_BYTE = 1000 RANDOM_WRITE_BYTE = 2000 fd = os.open('/dev/seeprom', os.O_RDONLY) fcntl.ioctl(fd, RANDOM_WRITE_BYTE, struct.pack('II', 10, 121)) r = fcntl.ioctl(fd, RANDOM_READ_BYTE, struct.pack('I', 10)) print ord(r[0])