[Python] python获得linux下的所有挂载点(mount points) →→→→→进入此内容的聊天室

来自 , 2020-09-26, 写在 Python, 查看 196 次.
URL http://www.code666.cn/view/d10ddbe8
  1. # execute the external "mount" command and parse the output.
  2.  
  3. import commands
  4.  
  5. mount = commands.getoutput('mount -v')
  6. lines = mount.split('\n')
  7. points = map(lambda line: line.split()[2], lines)
  8.  
  9. print points
  10.  
  11. #//python/8089

回复 "python获得linux下的所有挂载点(mount points)"

这儿你可以回复上面这条便签

captcha