Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def toHex(s):
- lst = []
- for ch in s:
- hv = hex(ord(ch)).replace('0x', '')
- if len(hv) == 1:
- hv = '0' + hv
- lst.append(hv)
- return reduce(lambda x, y: x + y, lst)
- def list_to_hex(list):
- ret = []
- for element in list:
- ret.append(toHex(element))
- return ret
- def checkfile(x):
- L = []
- while True:
- x = raw_input('Please write the file you want to comapre : ')
- if x == 'Escape':
- break
- fin = open(x, 'r')
- fin = fin.readlines()
- # L = []
- L.append(fin)
- for i in list:
- list_to_hex(i)
- return L
- print checkfile('a')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement