I want to get the unique id from an usb hard-drive with python for a project im working on. What is the easiest way of achieving this? Is there a better way to do it? Can this be done platform independent?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Use the system call to read in ‘lsusb’, and then parse the output.
Or an easier to parse solution would be the commands library.
And then you would manipulate or search output with regex for your device.