import sys, binascii
f = open(sys.argv[1], 'rb')
data = f.read()
f.close()
tmp = binascii.hexlify(data)
output = open(sys.argv[1] + '_output.jpg', 'wb')
output.write(binascii.unhexlify(tmp[::-1]))
output.close
import sys, binascii
f = open(sys.argv[1], 'rb')
data = f.read()
f.close()
tmp = binascii.hexlify(data)
output = open(sys.argv[1] + '_output.jpg', 'wb')
output.write(binascii.unhexlify(tmp[::-1]))
output.close