Enumerating drives in Python or wxPython

Alan Miller ajm at enteract.com
Wed Jul 12 23:44:13 EDT 2000


Lars Lundstedt (lars.lundstedt at telia.com) wrote:
>The subject line says it all. How do I do it?
>Anyone who knows?

import string, os

drivelist = []

for driveletter in string.uppercase:
    if os.path.isdir(driveletter + ":\\"):
        drivelist.append(driveletter)

print drivelist



More information about the Python-list mailing list