Python Redirect Stdout To Variable