473,378 Members | 1,142 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

generating uuids / guids

Is there a Python function that works on all platforms (not just Win32)
to generate such in the DCE / Microsoft format?

If not present, this looks like it would be a very Pythonic addition
to the standard library.
Jul 18 '05 #1
5 3121
Jon Perez <jb********@wahoo.com> writes:
Is there a Python function that works on all platforms (not just Win32)
to generate such in the DCE / Microsoft format?

If not present, this looks like it would be a very Pythonic addition
to the standard library.


Why do you say that adding Windows GUID generation to non-Windows
platforms would be Pythonic? Yeesh.
Jul 18 '05 #2
The DCE/OSF uuids I see in Linux ('uuidgen' command)and the Windows
guids look like they are the same format. They have the same number
of hex digits (although their generation methods may be different).
It would be good to have the same function interface for either.

Paul Rubin wrote:
Why do you say that adding Windows GUID generation to non-Windows
platforms would be Pythonic? Yeesh.

Jul 18 '05 #3
In article <2n************@uni-berlin.de>,
Jon Perez <jb********@wahoo.com> wrote:

Is there a Python function that works on all platforms (not just Win32)
to generate such in the DCE / Microsoft format?

If not present, this looks like it would be a very Pythonic addition
to the standard library.


Sure it would. Best way to start is to create a stand-alone third-party
library that implements the full DCE spec. Once it has proven its
utility and stability, send a note to python-dev suggesting that it be
added.

Keep in mind that UUID generation is a somewhat complex and tricky
business will likely require some kind of C library support (to get the
MAC address, to check if there's already a system-level UUID/GUID
generator present, to provide a "good" UUID if there's no network card,
and so on).
--
Aahz (aa**@pythoncraft.com) <*> http://www.pythoncraft.com/

"To me vi is Zen. To use vi is to practice zen. Every command is a
koan. Profound to the user, unintelligible to the uninitiated. You
discover truth everytime you use it." --*****@lion.austin.ibm.com
Jul 18 '05 #4
aa**@pythoncraft.com (Aahz) wrote in message news:<cf**********@panix1.panix.com>...
Sure it would. Best way to start is to create a stand-alone third-party
library that implements the full DCE spec. Once it has proven its
utility and stability, send a note to python-dev suggesting that it be
added.

Keep in mind that UUID generation is a somewhat complex and tricky
business will likely require some kind of C library support (to get the
MAC address, to check if there's already a system-level UUID/GUID
generator present, to provide a "good" UUID if there's no network card,
and so on).


Aren't there already uuid generation routines in both Linux and
Windows and wouldn't all that's needed be to wrap them in Python?
Jul 18 '05 #5
In article <f5**************************@posting.google.com >,
Jonathan P. <jb********@yahoo.com> wrote:
aa**@pythoncraft.com (Aahz) wrote in message news:<cf**********@panix1.panix.com>...

Sure it would. Best way to start is to create a stand-alone third-party
library that implements the full DCE spec. Once it has proven its
utility and stability, send a note to python-dev suggesting that it be
added.

Keep in mind that UUID generation is a somewhat complex and tricky
business will likely require some kind of C library support (to get the
MAC address, to check if there's already a system-level UUID/GUID
generator present, to provide a "good" UUID if there's no network card,
and so on).


Aren't there already uuid generation routines in both Linux and
Windows and wouldn't all that's needed be to wrap them in Python?


Absolutely. However, I don't know if any of them are cross-platform,
and if you have any intention of getting this into the standard library,
it'll need to be readily available on any platform with an ANSI C
compiler. Packaging is *NOT* trivial, and that's precisely why it's
rare to see code added to the standard library until it has proven
itself.

If you can find a way to implement this in pure Python, that probably
gives the biggest boost to the likelihood of getting into the standard
library. Python 2.4 is too far along to add this; that gives you 12-18
months for working this into usable shape.
--
Aahz (aa**@pythoncraft.com) <*> http://www.pythoncraft.com/

"To me vi is Zen. To use vi is to practice zen. Every command is a
koan. Profound to the user, unintelligible to the uninitiated. You
discover truth everytime you use it." --*****@lion.austin.ibm.com
Jul 18 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Shaun Clark | last post by:
Hello, I am trying to bring my entire organization from a Microsoft platform to a Linux one, starting with all of the servers we are currently running. Sun ONE ASP allows me to run ASP on Linux...
7
by: Mary | last post by:
Hi, I need some assistance with a query. To be honest, I'm not even sure it can be done. I'll try to keep the information limited to only what's relevant to what I have and what I am trying to...
4
by: J.Marsch | last post by:
I notice that when I generate various guids, they appear to have a mix of upper and lowercase letters. Is the uniqueness of a guid case-sensitive? In other words, if I generate a guid, and...
1
by: vector | last post by:
I've got an application that generates GUIDs. A lot of GUIDs. Lots of GUIDs that end up in files on disk, taking up space. I'd like to continue using the Guid.NewGuid() function as my unique tag...
11
by: Jeff | last post by:
Hi - I'm experiencing a strange problem when comparing 2 guids. In my trial, they're not equal. When I step through the (VB.NET) code, they are evaluated as equal, and when I enter the...
2
by: Howard Kaikow | last post by:
Being lazy, I sometimes copy a project to another directory, then tweak the code. A problem arises because then both projects have identical GUIDs in the .sln file, and in the assembly file. ...
14
by: Steven D'Aprano | last post by:
I have an application that will be producing many instances, using them for a while, then tossing them away, and I want each one to have a unique identifier that won't be re-used for the lifetime...
1
by: GHUM | last post by:
Hello, I created lots of guids via pywintypes.CreateGuid() on windows. Now I would like to run the same software on Linux / Solaris / FreeBSD. So I should produce "compatible" GUIDS on...
5
by: Claire | last post by:
Hi, I can imagine this question has been brought up before but I've spent all morning trying to find what I need on google without success. My application sits on Mysql or MS sql server engines...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.