Casey wrote:
... Is this the 'official' way to do this?... Why wouldn't you just use:
print(bytes.decode(b'abc\n'), end='')
Because that code is incapable of sending bytes that cannot be
interpreted as encoded in the "default" encoding. If you are
sending a picture, for example, all possible
Casey schrieb:
> On Feb 17, 12:33 pm, Christian Heimes wrote:
>> Yes, it's really the official way. You can google up the discussion
>> between me and Guido on the python-dev list if you don't trust me. ;)
>> The docs concur with me, too.
>>
>> http://docs.python.org/3.0/library/sys.html#sys.stdin
On Feb 17, 12:33 pm, Christian Heimes wrote:
> Yes, it's really the official way. You can google up the discussion
> between me and Guido on the python-dev list if you don't trust me. ;)
> The docs concur with me, too.
>
> http://docs.python.org/3.0/library/sys.html#sys.stdin
>
> Note: The standar
Casey wrote:
> Is this really the 'official' way to do this? This isn't meant to be
> confrontational or trolling; I honestly don't know the answer and I
> had similar questions when I first started with the 3.0 release
> candidates and I have yet to find a good answer in the Python v3.0
> documen
On 2009-02-17, Christian Heimes wrote:
> Peter Billam schrieb:
>> Greetings. (Newbie warning as usual) In Python3, sys.stdout is a
>> io.TextIOWrapper object; but I want to output bytes
>> (e.g. muscript -midi t > t.mid )
>> and they're coming out stringified :-( How can I either change the
>>
On Feb 17, 7:28 am, Christian Heimes wrote:
> Peter Billam schrieb:
>
> > Greetings. (Newbie warning as usual) In Python3, sys.stdout is a
> > io.TextIOWrapper object; but I want to output bytes
> > (e.g. muscript -midi t > t.mid )
> > and they're coming out stringified :-( How can I either cha
Peter Billam schrieb:
> Greetings. (Newbie warning as usual) In Python3, sys.stdout is a
> io.TextIOWrapper object; but I want to output bytes
> (e.g. muscript -midi t > t.mid )
> and they're coming out stringified :-( How can I either change the
> encoding on sys.stdout, or close sys.stdout and
En Tue, 17 Feb 2009 03:04:23 -0200, Peter Billam
escribió:
Greetings. (Newbie warning as usual) In Python3, sys.stdout is a
io.TextIOWrapper object; but I want to output bytes
(e.g. muscript -midi t > t.mid )
and they're coming out stringified :-( How can I either change the
encoding on sy
Greetings. (Newbie warning as usual) In Python3, sys.stdout is a
io.TextIOWrapper object; but I want to output bytes
(e.g. muscript -midi t > t.mid )
and they're coming out stringified :-( How can I either change the
encoding on sys.stdout, or close sys.stdout and reopen it in 'b'
mode, or dup(f