A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2006-June/065898.html below:

[Python-Dev] UUID module

[Python-Dev] UUID modulePaul Moore p.f.moore at gmail.com
Mon Jun 12 12:02:08 CEST 2006
On 6/12/06, Ka-Ping Yee <python-dev at zesty.ca> wrote:
> On Sun, 11 Jun 2006, Giovanni Bajo wrote:
> > Some comments on the code:
> >
> > > for dir in ['', r'c:\windows\system32', r'c:\winnt\system32']:
> >
> > Can we get rid of these absolute paths? Something like this should suffice:
> >
> > >>> from ctypes import *
> > >>> buf = create_string_buffer(4096)
> > >>> windll.kernel32.GetSystemDirectoryA(buf, 4096)
> > 17
> > >>> buf.value.decode("mbcs")
> > u'C:\\WINNT\\system32'
>
> I'd like to, but i don't want to use a method for finding the system
> directory that depends on ctypes.  Is there a more general way?

Why not use ctypes? This is precisely the situation it was designed
for. There's nothing more general (this is totally Windows-specific
after all). The alternative is to depend on pywin32, which is not part
of the core, or to write a custom C wrapper, which seems to me to be
precisely what we're trying to move away from...

Paul.
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4