Hi,
I am trying to unpack a binary file,

        rfile = open(filename,'rb')
        print "file Size", os.path.getsize(filename)
        text = rfile.read()
         print "Text", text
        while(text != 'EOF'):
                text = struct.unpack("!c",text)
                Message  = Message + struct.pack("!c",text)
                text = rfile.read()

Output:
file Size 112
Text 킶
}v/◇+1h?
   w#?'?CF
              ?V

Error:
error: unpack requires a string argument of length 1


Can anyone please tell me, the way to unpack the binay data from the file.

If the questions is very basic.I kindly apologize for it. I am not able to
get through it

Kindly help me
--
Thanks & Regards
V.Murugadoss
_______________________________________________
BangPypers mailing list
BangPypers@python.org
http://mail.python.org/mailman/listinfo/bangpypers

Reply via email to