enumerate drive names on windows

Emile van Sebille emile at fenx.com
Sun Nov 9 08:25:52 EST 2003


Frank Bechmann asks:
> is there some python standard or 'Python for Windows Extensions'
> functionality to iterate or list-return the available drives ('A:',
> 'B:', 'C:', ...) on a machine running windows?
>

win32api.GetLogicalDriveStrings()

returns a \x00 delimited string.  Use

win32api.GetLogicalDriveStrings()[:-1].split('\x00')

to create a list.

--

Emile van Sebille
emile at fenx.com






More information about the Python-list mailing list