Tim Roberts wrote:
Monica Leko <[EMAIL PROTECTED]> wrote:
I have a specific format and I need binary representation. Does
Python have some built-in function which will, for instance, represent
number 15 in exactly 10 bits?
For the record, I'd like to point out that even C cannot do this. You
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
>On May 20, 12:14 am, Tim Roberts <[EMAIL PROTECTED]> wrote:
>> Monica Leko <[EMAIL PROTECTED]> wrote:
>>
>> >I have a specific format and I need binary representation. Does
>> >Python have some built-in function which will, for instance, represent
>>
On May 20, 12:14 am, Tim Roberts <[EMAIL PROTECTED]> wrote:
> Monica Leko <[EMAIL PROTECTED]> wrote:
>
> >I have a specific format and I need binary representation. Does
> >Python have some built-in function which will, for instance, represent
> >number 15 in exactly 10 bits?
>
> For the record, I
On May 20, 10:30 am, Nick Craig-Wood <[EMAIL PROTECTED]> wrote:
> Monica Leko <[EMAIL PROTECTED]> wrote:
> > On May 18, 2:20?pm, Ken Starks <[EMAIL PROTECTED]> wrote:
> > > You want your file considered as a sequence of bits rather
> > > than a sequence of 8-bit bytes, do you?
>
> > Yes.
>
> > >
Monica Leko <[EMAIL PROTECTED]> wrote:
> On May 18, 2:20?pm, Ken Starks <[EMAIL PROTECTED]> wrote:
> > You want your file considered as a sequence of bits rather
> > than a sequence of 8-bit bytes, do you?
>
> Yes.
>
> > is the 10-bit bit-pattern to be stored at an arbitrary
> > bit-position in
On Sun, 18 May 2008 06:36:28 -0700 (PDT)
Monica Leko <[EMAIL PROTECTED]> wrote:
> Yes. I need arbitrary, 8bits, than 10 bits for something else, than
> sequence of bytes, than 10 bits again, etc.
Here's something to get you started. No guarantees, but I managed to
write four 10 bit numbers to a
Monica Leko <[EMAIL PROTECTED]> wrote:
>
>I have a specific format and I need binary representation. Does
>Python have some built-in function which will, for instance, represent
>number 15 in exactly 10 bits?
For the record, I'd like to point out that even C cannot do this. You need
to use shift
Monica Leko wrote:
On May 18, 2:20 pm, Ken Starks <[EMAIL PROTECTED]> wrote:
You want your file considered as a sequence of bits rather
than a sequence of 8-bit bytes, do you?
Yes.
is the 10-bit bit-pattern to be stored at an arbitrary bit-position in
the file
Yes. I need arbitrary, 8bits,
Monica Leko wrote:
Hi
I have a specific format and I need binary representation. Does
Python have some built-in function which will, for instance, represent
number 15 in exactly 10 bits?
The "struct" module will let you format Python data as a binary
object of specified format. But it doe
I admit that I was mostly just interested in getting your
question clarified, rather than having any great experise.
But a bit of Googling took me to the 'Bit vector' module,
[I googled: 'python ("bit array" OR "bit vector")']
which might be what you are after. I have no experience
with it, mysel
En Sun, 18 May 2008 10:36:28 -0300, Monica Leko <[EMAIL PROTECTED]> escribió:
> On May 18, 2:20 pm, Ken Starks <[EMAIL PROTECTED]> wrote:
>> You want your file considered as a sequence of bits rather
>> than a sequence of 8-bit bytes, do you?
>
> Yes.
>
>> is the 10-bit
>> bit-pattern to be stored
On May 18, 2:20 pm, Ken Starks <[EMAIL PROTECTED]> wrote:
> You want your file considered as a sequence of bits rather
> than a sequence of 8-bit bytes, do you?
Yes.
> is the 10-bit
> bit-pattern to be stored at an arbitrary bit-position in
> the file
Yes. I need arbitrary, 8bits, than 10 bits
You want your file considered as a sequence of bits rather
than a sequence of 8-bit bytes, do you? is the 10-bit
bit-pattern to be stored at an arbitrary bit-position in
the file, or is the whole file regularly subdivided
at 10-bit intervals?
Monica Leko wrote:
Hi
I have a specific format and
Hi
I have a specific format and I need binary representation. Does
Python have some built-in function which will, for instance, represent
number 15 in exactly 10 bits?
--
http://mail.python.org/mailman/listinfo/python-list
14 matches
Mail list logo