how on earth do i get a drive list?

Bruce Sass bsass at freenet.edmonton.ab.ca
Thu Jul 26 16:16:17 EDT 2001


On Thu, 26 Jul 2001, G. Willoughby wrote:

> how on earth do i get a drive list? i've been searching for a command to
> display a tuple or list containing all available drives, but i can't find
> it! is it just me or are the standard python docs quite confusing. oh well
> any ideas out there?

import os
os.system("<whatever command works on your platform>")

or

output = os.popen...<system level command>...

Python is not a low level scripting language that needs to know these
kind of things... but I agree it would be nice if it did, because then
I could put "exec python" at the end of my .bash_profile and still
have an easy to use shell without defining a bunch of helper
functions in PYTHONSTARTUP.


- Bruce





More information about the Python-list mailing list