python_cmd: take loc test
port more to loc