0

Using python, I would like to find the path to a drive by it's label on all platforms (linux,windows,mac), for example I would like to search for the drive named STUFF and get the path (e:/ or /media/patrick/e/ ) back or an error if it does not exist.

geek1011
  • 495
  • 9
  • 19
  • What have you found by searching? There seem to be a number of solutions for windows and linux. – Peter Wood May 02 '16 at 20:59
  • @PeterWood I have found ways to find a label by the drive name but not the other way around – geek1011 May 02 '16 at 21:19
  • If you do that for each drive you have a solution. – Peter Wood May 02 '16 at 21:22
  • @PeterWood But how can I get an os-independent list of drives? – geek1011 May 02 '16 at 21:38
  • See [hopeful](https://stackoverflow.com/questions/12672981/python-os-independent-list-of-available-storage-devices) and [not hopeful](https://stackoverflow.com/questions/3596485/python-cross-platform-way-to-list-disk-drives-on-linux-windows-and-mac) – Peter Wood May 03 '16 at 06:57

0 Answers0