R. David Murray wrote:
... Here is some example code that works:out=open('temp', "wb") out.write(b"BM") def write_int(out, n): bytesout=bytes(([n&255), (n>>8)&255, (n>>16)&255, (n>>24)&255]) out.write(bytesout) write_int(out, 125)
or even: import struct ... def write_int(out, n): out.write(struct.pack('<l', n)) write_int(out, 125) --Scott David Daniels scott.dani...@acm.org -- http://mail.python.org/mailman/listinfo/python-list