how can the directory of a usb drive connected to a system be obtained?
问题 I need to obtain the path to the directory created for a usb drive(I think it's something like /media/user/xxxxx) for a simple usb mass storage device browser that I am making. Can anyone suggest the best/simplest way to do this? I am using an Ubuntu 13.10 machine and will be using it on a linux device. Need this in python. 回答1: This should get you started: #!/usr/bin/env python import os from glob import glob from subprocess import check_output, CalledProcessError def get_usb_devices(): sdb