[Python-ideas] hexdump

Guido van Rossum guido at python.org
Sat May 12 19:14:46 CEST 2012


Rather than bikeshedding, why not implement the common formats and
flags implemented by the venerable 'od' command? It's been
time-tested...

On Sat, May 12, 2012 at 9:20 AM, Floris Bruynooghe <flub at devork.be> wrote:
> On 12 May 2012 09:59, anatoly techtonik <techtonik at gmail.com> wrote:
>> hexdump(bytes)   - produce human readable dump of binary data,
>
> +1 on this basic function, that would be very nice in the stdlib.  Now
> I always need to go and dig up my own function from somewhere.
>
> A certain deal of bikeshedding would be required on the function
> signature however, I'd go with something like:
>
> hexdump(data, rowsize=16, offsets=True, ascii=True)
>
> Where rowsize is the number of bytes on one row, offsets controls
> showing the byte number (in hex) of the first byte of each row and
> ascii controls showing the 7-bit printable characters in a right hand
> column.
>
> This would cover my needs, I'm sure other people will come up with
> more must-haves.
>
> Regards,
> Floris
>
> --
> Debian GNU/Linux -- The Power of Freedom
> www.debian.org | www.gnu.org | www.kernel.org
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> http://mail.python.org/mailman/listinfo/python-ideas



-- 
--Guido van Rossum (python.org/~guido)



More information about the Python-ideas mailing list