python write to stdout binary