Bits and bytes?

Christopher Armstrong radix at twistedmatrix.com
Wed Jun 12 11:36:02 EDT 2002


>>>>> "Guyon" == Guyon Morée <gumuz at looze.net> writes:

    Guyon> ok, thanx a lot.  there's one thing i am missing though... how do i
    Guyon> write '011010110101' as 'binary bits' to a file?

You can only write strings to a file. So use the unbinarify function to convert
the bit-string to a "data" string, and write that.


    Guyon> "Christopher Armstrong" <radix at twistedmatrix.com> wrote in message
    Guyon> news:mailman.1023890477.2592.python-list at python.org...

    Guyon> http://twistedmatrix.com/users/moshez/binary.py

    Guyon> Moshe Zadka wrote this because he was annoyed at all the people in
    Guyon> #python asking how to do this ;-)


-- 
                                Chris Armstrong
                         << radix at twistedmatrix.com >>
                http://twistedmatrix.com/users/carmstro.twistd/






More information about the Python-list mailing list