手机
当前位置:查字典教程网 >脚本专栏 >python >python获得linux下所有挂载点(mount points)的方法
python获得linux下所有挂载点(mount points)的方法
摘要:本文实例讲述了python获得linux下所有挂载点(mountpoints)的方法。分享给大家供大家参考。具体实现方法如下:#execut...

本文实例讲述了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 points)的方法】相关文章:

python从ftp下载数据保存实例

python中的sort方法使用详解

python中文乱码的解决方法

python 字符串split的用法分享

Python random模块(获取随机数)常用方法和使用例子

Python BeautifulSoup中文乱码问题的2种解决方法

python实现监控linux性能及进程消耗性能的方法

python中定义结构体的方法

python类型强制转换long to int的代码

python中精确输出JSON浮点数的方法

精品推荐
分类导航