Q:

How to generate UUID/GUID in Python 2.4 as UUID module is missing

Not able to find a way to generate UUID in Python 2.4 as the module was made available in Python 2.5 and is stable in 2.7. My machine is centos5 & due to other dependency cant really use or upgrade to Python 2.7

A:

I did it with
#!/usr/bin/env python

import commands

def uuid():
        return commands.getstatusoutput('uuidgen')

if __name__ == "__main__":
        print uuid()[1]

It gives nice expected answer e79a890c-5e3a-4c3a-bfdb-5377389b69ac

