views:

131

answers:

1

What is the best way to create a unique user ID in Python, using UUID?

+8  A: 

I'd go with uuid

from uuid import uuid4
def new_user_id():
    return uuid4().hex
lazy1