Is there any way to detect when a usb flash drive/stick/etc gets plugged in a usb port? To be more specific, I need to have a way to detect usb insertion/removal and use this information in a python script. I'm posting here because I am working in the elementary OS. If I'm posting in the wrong stackexchange forum feel free to move it accordingly. Thank you for your time.
1 Answer
In modern Linux kernels, you can use udev
to detect removable disks. You can read about udev
at:
I'm not a Python expert, but i have find a module about using udev
, so you can try with it: