List of disk drives on Windows?

python at bdurham.com python at bdurham.com
Tue May 20 16:01:55 EDT 2008


Mensanator,

<snip>
>>> import os.path
>>> dl = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
>>> drives = ['%s:' % d for d in dl if os.path.exists('%s:' % d)]
>>> drives
</snip>

Very clever!

Malcolm



More information about the Python-list mailing list