Hi. I have a .raw file and I want to display it as hex. why? because i want to try and replicate what 010 Editor can do which is read any sort of file and display in whatever format user desires (plus it can be used to edit and stuff) but I'm focusing on .raw files only and to display in hex only.
i sort of understand that binascii.hexlify() returns the hexadecimal representation of the binary data (.raw files are binary data right?) but when i do :
content = open(fileName, "rb") byte = content.read(1) hexadecimal = binascii.hexlify(byte) self.file_content.setText(hexadecimal)
I get :
TypeError: setText(self, str): argument 1 has unexpected type 'bytes' , what does that mean? which argument? why doesn't it "return hexadecimal....."?
just to clarify, Im using gui to display the data so
self.file_content.setText() is a readonly text edit box. And im using Windows 8.1/Anaconda