python read input from stdin line by line