A5下载 - 努力做内容最丰富最安全的下载站!

A5站长下载站

当前位置:A5下载 > 源码技巧 > 父类数据 > python获得linux下所有挂载点(mount points)的方法

python获得linux下所有挂载点(mount points)的方法

时间:2015-04-29 11:24作者:zhao人气:121

本文实例讲述了python获得linux下所有挂载点(mount points)的方法。分享给大家供大家参考。具体实现方法如下:

# execute the external "mount" command

# and parse the output.

import commands

mount = commands.getoutput('mount -v')

lines = mount.split('n')

points = map(lambda line: line.split()[2], lines)

print points

希望本文所述对大家的Python程序设计有所帮助。

标签python,获得,linux,所有,挂载点,mount,p

相关下载

查看所有评论+

网友评论

网友
您的评论需要经过审核才能显示

公众号