enumerate drive names on windows

F

Frank Bechmann

yes, that's the simple question:

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?

Thx in advance.
 
E

Emile van Sebille

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,562
Members
45,038
Latest member
OrderProperKetocapsules

Latest Threads

Top