I don't know any library that does this, but you can just run mount and return all the mount points in the list with something like:
import commands mount = commands.getoutput('mount -v') mntlines = mount.split('\n') mntpoints = map(lambda line: line.split()[2], mntlines)
The code extracts all the text from mount -v , breaks the output into a list of lines, and then parses each line for the third field, which represents the path of the mount point.
If you want to use df , then you can do it too, but you need to delete the first row that contains the column names:
import commands mount = commands.getoutput('df') mntlines = mount.split('\n')[1::]
Once you have the mount points ( mntpoints list), you can use for in to process each of them using code as follows:
for mount in mntpoints:
Python has a mail processing module called smtplib , and you can find information in Python Docs
source share