How can I generate a unique ID in Python?

Ryan picture Ryan · Jul 31, 2009 · Viewed 265.6k times · Source

I need to generate a unique ID based on a random value.

Answer

Michael Aaron Safyan picture Michael Aaron Safyan · Jul 31, 2009

Perhaps uuid.uuid4() might do the job. See uuid for more information.