Re-implementation of Simon's bash processing in python