Using ctypes
and the code shown in the first answer in this post: Get full computer name from a network drive letter in python, it is possible to get the drive paths for every network drive, or a selected few.
The get_connection
function given will throw an error if the drive is not a network drive, either local or removable drives, this can be accounted for with
# your drive list
available_drives = ['%s:' % d for d in string.ascii_uppercase if os.path.exists('%s:' % d)]
for drive in available_drives:
try:
# function from linked post
print(get_connection(drive))
except WindowsError: # thrown from local drives
print('{} is a local drive'.format(drive))