import mmap import os f = os.open('/dev/mem', os.O_RDWR | os.O_SYNC) mv = memoryview(mmap.mmap(f, 4096, prot=mmap.PROT_READ|mmap.PROT_WRITE, flags=mmap.MAP_SHARED, offset=0xFF706000)) mvi = mv.cast('I') mvi[4] = 0x11223344 print(hex(mvi[5]))