python implementation of command line cut