Thanks.
-- Stephen
import win32api, win32file
drives = [drive for drive in
win32api.GetLogicalDriveStrings().split('\x00')[:-1] if
win32file.GetDriveType(drive) == win32file.DRIVE_FIXED]
Cheers,
Simon Brunning
TriSystems Ltd.
sbru...@trisystems.co.uk
-----------------------------------------------------------------------
The information in this email is confidential and may be legally privileged.
It is intended solely for the addressee. Access to this email by anyone else
is unauthorised. If you are not the intended recipient, any disclosure,
copying, distribution, or any action taken or omitted to be taken in
reliance on it, is prohibited and may be unlawful. TriSystems Ltd. cannot
accept liability for statements made which are clearly the senders own.
* win32file.DRIVE_CDROM
* win32file.DRIVE_FIXED
* win32file.DRIVE_NO_ROOT_DIR
* win32file.DRIVE_RAMDISK
* win32file.DRIVE_REMOTE
* win32file.DRIVE_REMOVABLE
* win32file.DRIVE_UNKNOWN
So if you wanted to see *all* local drives, including CD-ROMs, floppies and
so on, for example, you'd use:
drives = [drive for drive in
win32api.GetLogicalDriveStrings().split('\x00')[:-1] if
win32file.GetDriveType(drive) in [win32file.DRIVE_FIXED,
win32file.DRIVE_CDROM, win32file.DRIVE_REMOVABLE]]
Enjoy.