title: How to get the address of mmap-ed memory in Python?
body: <p>I cannot figure how to get the virtual address of the standard <strong>mmap</strong> objects in Python (from the mmap module).
  The documented methods only seem to access the memory as array of bytes or as character strings.</p>
  
  <p>But I need to access the mmap'ped memory by precisely 2 or 4 bytes at once - because this memory in my application is mapped to hardware registers (think /dev/mem or GPIO or such). Accessing memory in this way is possible with <strong>ctypes</strong> module - but for this I need the <strong>pointer</strong> - or virtual address - of the mapping.</p>
  
  <p>Currently I overcome this by using the native open() and mmap() functions from libc (thanks to the same ctypes) but would rather not.</p>
  
  <p>Why the mmap module won't provide easy way to get the memory address? Hope I'm missing something obvious...</p>
  
  <p>-- dd</p>