Generate Unique id


/ Published in: Python
Save to your folder(s)



Copy this code and paste it in your HTML
  1. import os
  2.  
  3. def unique_id():
  4. return os.urandom(10).encode('hex')
  5. print " Printing Unique_id"
  6. a=unique_id()
  7. print a
  8.  
  9. OR
  10.  
  11. import uuid
  12. print uuid.uuid4()

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.