Tuesday, 24 May 2011

Simple Python Command to generate a random GUID

Every so often I need to generate a GUID for a MS Proj file. The simple python command will create one for me:
python -c "import uuid;print uuid.uuid4()"
Changing that to a emacs function so I can insert them where ever I need we get:
(defun genUUID ()
  "Generates a UUID"
  (interactive)
  (shell-command "python -c \"import uuid;print uuid.uuid4()\"" t)
)

No comments: