Translated do_ipc() function

I'm using autopep8 (https://github.com/hhatto/autopep8) now to help me write more readable code. Please feel free to review it an change. There are lots of TODO on comments where I was not sure how to translate to python. Mainly pointers. :-)