Take the 2-minute tour ×

how to get drive letter and name of the USB connected to the system using python in windows

share|improve this question

2 Answers 2

It will give you list of all in use drives letters. Hope this will help

import win32api

drives = win32api.GetLogicalDriveStrings()
drives = drives.split('\000')[:-1]
print drives
share|improve this answer

Try this to list all drives in windows:

>>> import os.path
>>> drives = ['%s:' % d for d in dl if os.path.exists('%s:' % d)]
>>> drives
share|improve this answer

Your Answer


