Python Forum
How to make a function for auto generated id
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to make a function for auto generated id
#1
Hi Guys,
Could you please help me out about how we can make a function in Python which can generate auto numeric id whenever calling that function?

Thnaks
Reply
#2
Please be a bit more specific
Reply
#3
https://docs.python.org/3/library/uuid.html Wrote:This module provides immutable UUID objects (the UUID class) and the functions uuid1(), uuid3(), uuid4(), uuid5() for generating version 1, 3, 4, and 5 UUIDs as specified in RFC 4122.

If all you want is a unique ID, you should probably call uuid1() or uuid4(). Note that uuid1() may compromise privacy since it creates a UUID containing the computer’s network address. uuid4() creates a random UUID.

Depending on support from the underlying platform, uuid1() may or may not return a “safe” UUID. A safe UUID is one which is generated using synchronization methods that ensure no two processes can obtain the same UUID. All instances of UUID have an is_safe attribute which relays any information about the UUID’s safety, using this enumeration:
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  HOW TO USE C# GENERATED DLL davide_vergnani 2 1,561 Jun-12-2023, 03:35 PM
Last Post: davide_vergnani
  how to make bot that sends instagram auto password reset code kraixx 2 1,283 Mar-04-2023, 09:59 PM
Last Post: jefsummers
  Using Dictionary to Test Evenness of Distribution Generated by Randint Function new_coder_231013 6 3,200 Feb-23-2021, 01:29 PM
Last Post: new_coder_231013
  How to make global list inside function CHANKC 6 2,981 Nov-26-2020, 08:05 AM
Last Post: CHANKC
  want to make auto login with data R3born 3 2,179 Sep-11-2020, 07:06 PM
Last Post: R3born
  How to make this function general to create binary numbers? (many nested for loops) dospina 4 4,333 Jun-24-2020, 04:05 AM
Last Post: deanhystad
  how to make my function be a generator Skaperen 2 1,994 Jan-27-2020, 01:07 AM
Last Post: Skaperen
  auto supply values to a python script(function) from text file metro17 4 2,484 Oct-26-2019, 01:25 AM
Last Post: ichabod801
  Rewrite a function to make it work with 'bottle-pymysql' nikos 1 1,937 Feb-26-2019, 02:59 PM
Last Post: nikos
  How can I make this function faster? Brennan 10 6,066 Jun-29-2018, 08:33 PM
Last Post: ichabod801

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020