The Mac runs your code in the background when there's a new screenshot. The only slow part is actually setting up that call to translate between Python types and objective C types. Pi OBJC does all that sort of translation across the bridge between Python and Objective C. You don't really even really have to think about it.