I've tried everything to write just one byte to a file in python.
i = 10
fh.write( six.int2byte(i) )
will output '0x00 0x0a'
fh.write( struct.pack('i', i) )
will output '0x00 0x0a 0x00 0x00'
I want to write a single byte with the value 10 to the file.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…