"Andy Leszczynski" wrote in message
news:[EMAIL PROTECTED]
>I have got following program:
>
> import sys
> import binascii
> from string import *
> sys.stdout.write(binascii.unhexlify("41410A4141"))
>
>
> when I run under Unix I got:
>
> $ python u.py > u.bin
> $ od -t x1 u.bin
> 000 41 41 0a
Andy Leszczynski wrote:
> when I run under Unix I got:
>
> $ python u.py > u.bin
> $ od -t x1 u.bin
> 000 41 41 0a 41 41
>
> and under Windows/Cygwin following:
>
> $ python u.py > u.bin
> $ od -t x1 u.bin
> 000 41 41 0d 0a 41 41
> 006
>
> The question is how can I pipe out binary cont
Erik Max Francis <[EMAIL PROTECTED]> writes:
> > I've written lots of things whose standard out was designed
> > specifically to be read by another program, but never as binary data.
>
> Plenty of applications use that functionality and depend on it. See
> cjpeg, djpeg, the pbmplus library, and s
marduk <[EMAIL PROTECTED]> writes:
> On Wed, 2005-10-12 at 00:16 -0400, Mike Meyer wrote:
> [...]
>> It's not normal to write binary content to stdout - you normally write
>> it to a file. Open the file with open(name, 'wb') to write binaries.
>>
>
> It is interesting that as a "Unix consultant"
Mike Meyer wrote:
> I watched the Unix world grow up, and it ain't normal to me.
Since there's no distinction between a file opened in binary mode and in
text mode on Unix, there is no difference.
> I don't
> think I've ever written a program that wrote binary data to standard
> out, not in nea
Andy Leszczynski writes:
> Mike Meyer wrote:
>> It's not normal to write binary content to stdout - you normally write
>
> Well, I grew up in the Unix world and it is normal over there.
I watched the Unix world grow up, and it ain't normal to me. I don't
think I've ever written a program that wr
On Wed, 2005-10-12 at 00:16 -0400, Mike Meyer wrote:
[...]
> It's not normal to write binary content to stdout - you normally write
> it to a file. Open the file with open(name, 'wb') to write binaries.
>
It is interesting that as a "Unix consultant" you should make that
claim. Especially since
Mike Meyer wrote:
> It's not normal to write binary content to stdout - you normally write
Well, I grew up in the Unix world and it is normal over there.
I am still curious which layer adds that 0xd. Is it python, cygwin,
windows ...
Thx for reply, Andy
--
http://mail.python.org/mailman/listin
Andy Leszczynski writes:
> I have got following program:
>
> import sys
> import binascii
> from string import *
> sys.stdout.write(binascii.unhexlify("41410A4141"))
>
>
> when I run under Unix I got:
>
> $ python u.py > u.bin
> $ od -t x1 u.bin
> 000 41 41 0a 41 41
>
> and under Windows/Cygwi
I have got following program:
import sys
import binascii
from string import *
sys.stdout.write(binascii.unhexlify("41410A4141"))
when I run under Unix I got:
$ python u.py > u.bin
$ od -t x1 u.bin
000 41 41 0a 41 41
and under Windows/Cygwin following:
$ python u.py > u.bin
$ od -t x1 u.bi
10 matches
Mail list logo