Convert from Oracle to Microsoft GUID, reversing first half endianness.
With struct packing:
def convert(guidstring):
ms = guidstring.replace('-','').replace('{','').replace('}','')
a,b,c,d = ms[0:8], ms[8:12], ms[12:16], ms[16:]
x = struct.pack('<LHH',int(a,16),int(b,16),int(c,16)).encode('hex')
return (x+d).upper()