本文實例講述了python獲得linux下所有掛載點(mount points)的方法。分享給大家供大家參考。具體實現方法如下:
# execute the external "mount" command# and parse the output.import commandsmount = commands.getoutput('mount -v')lines = mount.split('/n')points = map(lambda line: line.split()[2], lines)print points
希望本文所述對大家的Python程序設計有所幫助。
新聞熱點
疑難解答