Kent Johnson wrote:
>
> I guess the conversion actually happens in sys.stdout.write(), not in print.
That's good to know, thanks for trying it out.
--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!
_
Kent Johnson wrote:
> Christopher Barker wrote:
>> Robin Dunn wrote:
>>> Just replace sys.stdout with an object with a write() method that does
>>> what you want.
>> I don't think that will do it, as "print" will have already converted
>> the object to a string, and it does that with str(), which
Christopher Barker wrote:
> Robin Dunn wrote:
>> Just replace sys.stdout with an object with a write() method that does
>> what you want.
>
> I don't think that will do it, as "print" will have already converted
> the object to a string, and it does that with str(), which calls
> object.__str__
Christopher Barker wrote:
> Robin Dunn wrote:
>> Just replace sys.stdout with an object with a write() method that does
>> what you want.
>
> I don't think that will do it, as "print" will have already converted
> the object to a string, and it does that with str(), which calls
> object.__str__
Robin Dunn wrote:
> Just replace sys.stdout with an object with a write() method that does
> what you want.
I don't think that will do it, as "print" will have already converted
the object to a string, and it does that with str(), which calls
object.__str__, which used the default encoding
Christopher Barker wrote:
> Kent Johnson wrote:
>> You can, with sys.setdefaultencoding(). See here for discussion of how:
>> http://blog.ianbicking.org/illusive-setdefaultencoding.html
>
> > and here for arguments that this is a bad idea (mostly because it makes
> > your code non-portable):
>
Kent Johnson wrote:
> You can, with sys.setdefaultencoding(). See here for discussion of how:
> http://blog.ianbicking.org/illusive-setdefaultencoding.html
> and here for arguments that this is a bad idea (mostly because it makes
> your code non-portable):
> http://faassen.n--tree.net/blog/view