MPG: added some python platform handling code, now testing on macos too