How do I find (in Python 3.x) the default location where flash drives automatically mount when plugged in on a computer that I happen to be using at the time? (It could be any of various non-specific Linux distributions and older/new versions. Depending on which one it is, it may mount at such locations as /media/driveLabel, /media/userName/driveLabel, /mnt/driveLabel, etc.)
I was content just assuming /media/driveLabel until Ubuntu updated its default mount location to include the username (so, now I can't use a static location for bookmarked file settings of a portable app I made across my computers, since I use multiple usernames). So, the paths for the bookmarked files need to be updated every time I use a new computer or user. Note that files on the hard drives are also bookmarked (so, those don't need to be changed; they're set not to load if you're not on the right computer for them).
Anyway, now I'm not content just going with /media mounts, if there's a solution here. I would prefer to be able to find this location without having to mount something and find a path's mount location first, if possible (even though that may help me with the problem that sparked the question). It seems like there should be some provision for this, whether in Python, or otherwise.
In other words, I want to be able to know where my flash drive is going to mount (sans the drive label part)—not where it's already mounted.
EDIT: If /media/username/drivelabel is pretty standard for the automatic mounts across all the major distributions that support automatic mounting (the latest versions, at least, as I seem to recall that Ubuntu didn't always include the username), feel free to let me know, as that pretty much answers the question. Or, you could just tell me a list of automatic flash drive mount locations specific to which major distributions. I guess that could work (though I'd have to update it if they changed things).
FYI EDIT: For my problem I'll probably just save the mount location with the bookmark (so my program knows what part of the bookmark path it was when I open it), and replace that in the bookmark path with the new current mount location when a user loads the bookmark.
Why don't you use the Udev to force the location by your self, simply you can create a UDEV script that keep listening on the drives insertion and map the inserted USB drive to specific location on the machine
How do I find the location where flash drives automatically mount in Python?