-4

I need to create a short unique ID which is a random sequence of numbers in python. So i need to allocate the short sequence to a user and also store it in a text file

Can some one please help me with this and give me an example??

1 Answers1

1

Use uuid:

import uuid
uuid.uuid4()

results in things like:

UUID('35ad767c-da61-4731-adbc-cdd96efac2c4')

And a link to the python docs: https://docs.python.org/3.5/library/uuid.html

Eric Dill
  • 2,166
  • 2
  • 17
  • 15