# coding=utf-8
import socket
import sys
import string
import re
import os
import struct
def read_bin_file(file_name):
file_object = open(file_name, 'rb')
try:
file_content = file_object.read(1)
finally:
file_object.close()
data = struct.unpack('B', file_content)
print "%x" %(data)
if __name__ == '__main__':
read_bin_file('abc.bin')
import socket
import sys
import string
import re
import os
import struct
def read_bin_file(file_name):
file_object = open(file_name, 'rb')
try:
file_content = file_object.read(1)
finally:
file_object.close()
data = struct.unpack('B', file_content)
print "%x" %(data)
if __name__ == '__main__':
read_bin_file('abc.bin')