redirect stdout python to variable