Re: Endianness conversion

2007-02-24 Thread Daniel Harding
On Feb 24, 9:39 am, Toby <[EMAIL PROTECTED]> wrote:
> As part of a program I'm writing, I need to save to disk big amounts of
> data (hundreds of MB, in 8kB chunks) swapping every couple of bytes.
>
> I obviously cannot do it in a Python loop.
>
> Is there a function I could use in the standard library, or do I have to
> write my own C extension?

Try the using the array module.  array objects provide a byteswap
method which reverses endianness.

-Daniel

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python vs. Lisp -- please explain

2006-02-22 Thread Daniel Harding
Steven D'Aprano wrote:
> Who says Python is so slow? I've just got Python to count from 0 up to
> 100,000, and it only took 7 milliseconds. That's at least 12 milliseconds
> faster than I can count on my fingers.

+1 QOTW

-- 
http://mail.python.org/mailman/listinfo/python-list