Hi, I have opened a unicode file for writing:
import codecs file = codecs.open( "somefile.dat", "wb", "utf-16" ) and I attempt to do this: file.write( struct.pack( "I", 5000 ) ) However, this won't work because the encoding of the string returned by "pack" isn't unicode. I'm a bit confused right now as to how I can get this to work. I can't allow the unicode-ness of the file interfere with the actual order of the bytes that pack() is returning (In other words, don't pack NULL characters in there) Thanks.
-- http://mail.python.org/mailman/listinfo/python-list