Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- "x7fxe8x89x00x00x00x60x89xe5x31xd2x64x8bx52"
- with open('a', 'rb') as f:
- byte = f.read(1)
- hexbyte = '\x%02s' % byte
- print hexbyte
- txt = open('out.txt', 'w')
- print >> txt, hexbyte
- txt.close()
- from binascii import hexlify
- with open('test', 'rb') as f:
- print(hexlify(f.read()).decode('utf-8'))
- with open('input_file', 'rb') as file:
- print repr(file.read())
- with open('input_file', 'rb') as file:
- print "\x" + "\x".join([c.encode('hex') for c in file.read()])
- with open("default.png",'rb') as file_png:
- a = file_png.read()
- l = []
- l.append(a)
- print l
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement