python read line from stdout