Generate a UUID on the command line with Python

Sometimes I want to manually generate a UUID for some test or example data.

It’s handy to have this Python snippet in Bash history to quickly do that:

python -c 'import uuid; print(uuid.uuid4())'

Tech mentioned