Paul Moore wrote: > On 3/7/06, Phillip J. Eby <[EMAIL PROTECTED]> wrote: >> At 06:29 AM 3/7/2006 +0100, Fredrik Lundh wrote: >>> see subject and http://python.org/sf/1368955 >>> >>> comments ? >> would be nice if you could just call UUID() to create a generic UUID in a >> platform-appropriate way. PEAK's uuid module does this such that if >> win32all is present, you get a Windows GUID, or if you have a FreeBSD 5+ or >> NetBSD 2+ kernel you use the local platform uuidgen API. See e.g.: > > Given that ctypes is going to be in Python 2.5, it might be reasonable > to use it to access platform-specific APIs like this. It certainly > makes some sense for Windows, where running an external process is > slow, and the existence of suitable external utilities (and the format > of their output!) is unreliable... (I haven't looked at the code, so I > don't know if this applies to Ping's use of ipconfig). >
IMO that is a perfect use-case for ctypes - access 2 or 3 platform-specific api functions. Too bad that ctypes whill be an optional module, so I'm not sure if it could be used in the Python library itself. Thomas _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com