0 votes
1 view
in Python by (47.8k points)

How do I create a GUID in Python that is platform independent? I hear there is a method using ActivePython on Windows but it's Windows only because it uses COM. Is there a method using plain Python?

1 Answer

0 votes
by (107k points)

To create GUID/UUID you can use the following piece of code:-

import uuid

uuid.uuid4()

str(uuid.uuid4()) 

uuid.uuid4().hex 

image

Related questions

0 votes
1 answer
asked Aug 8, 2019 in Web Technology by Sammy (47.8k points)
0 votes
1 answer
asked Jul 30, 2019 in Java by Krishna (2.6k points)
0 votes
1 answer
0 votes
1 answer
asked Jul 14, 2020 in Python by ashely (50.5k points)
0 votes
1 answer
asked Jul 14, 2020 in Python by ashely (50.5k points)
Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...