Hi:
I've conjured up the idea of building a hex line editor as a first real
Python programming exercise.
To begin figuring out how to display a line of data as two-digit hex
bytes, I created a hunk of data then printed it:
ln = '\x00\x01\xFF 456789abcdef'
for i in range(0,15):
print
CC schreef:
Hi:
I've conjured up the idea of building a hex line editor as a first real
Python programming exercise.
To begin figuring out how to display a line of data as two-digit hex
bytes, I created a hunk of data then printed it:
ln = '\x00\x01\xFF 456789abcdef'
for i in
Roel Schroeven wrote:
CC schreef:
ln = '\x00\x01\xFF 456789abcdef'
# This works:
import sys
for i in range(0,15):
sys.stdout.write( '%.2X' % ord(ln[i]) )
print
Is that the best way, to work directly on the stdout stream?
It's not a bad idea: print is mostly designed to be used in