[Tutor] Generating unique ID
srilyk at gmail.com
Wed Oct 28 20:07:08 CET 2009
On Wed, Oct 28, 2009 at 1:52 PM, Timo List <timomlists at gmail.com> wrote:
> I'm writing an application which will hold a database of people. Ofcourse,
> people can have the same name, so I want to stock them with an unique ID.
> I've searched and found some things:
> - uuid.uuid4()
> - id(name)
> - os.urandom(n)
> But they seem overkill to me. Well, maybe not id().
> What should I use the best for this? Maybe examples of other programs that
> do something alike?
You could use SQLite... I believe it supports autoincrement. If you just
want a random number, you can use the random library.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Tutor