Python Capture Stdout To File. stderr with a file object, but that's really not a good way