Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.python
Re: system32 directory
Tim Golden
3/7/2008 8:50:00 AM
Robert Dailey wrote:
> On Thu, Mar 6, 2008 at 2:42 AM, Tim Golden <mail@timgolden.me.uk> wrote:
>> <fishing advice>
>> First thing to do when asking "How do I do X in Python under Windows?"
>> is to stick -- python X -- into Google and you get, eg:
>>
>>
>>
http://aspn.activestate.com/ASPN/docs/ActivePython/2.2/PyWin32/win32api__GetSystemDirectory...
>>
>> which suggests that the win32api module from the pywin32 modules has
>> the function you need.
>> </fishing advice>
>>
>> And sure enough...
>>
>> <dump>
>> Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit
>> (Intel)] on win32
>> Type "help", "copyright", "credits" or "license" for more information.
>> >>> import win32api
>> >>> win32api.GetSystemDirectory ()
>> 'C:\\WINDOWS\\system32'
>> >>>
>> </dump>
>>
>> TJG
>>
>
> I was aiming to figure out if the standard modules shipped with Python could
> do this already before I started using 3rd party libraries. Thanks.
Ah. Sorry. I'm sure you can call it via ctypes (built in
from Python 2.5). But even if I'd realised that's what
you'd wanted, I'd probably have given the original answer
because pywin32 pretty much *is* standard library for any
Python installation I do on Win32 :)
TJG
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
Re: system32 directory
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password