def file_hex(file):
if os.path.exists(file):
hex_list = []
infile = open(file, "rb")
for i in infile.read():
hex_list.append(hex(i)[2:])
infile.close()
return ''.join(hex_list)
else:
print('文件不存在')
10-27
2221
01-23
3116