Working shared memory in Python