Advertisement
Guest User

Untitled

a guest
May 27th, 2011
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.24 KB | None | 0 0
  1. #!/usr/bin/env python
  2.  
  3. from subprocess import Popen, PIPE
  4.  
  5. output = Popen('lsmod', stdout=PIPE).communicate()[0]
  6.  
  7. output = output.splitlines()
  8.  
  9. modules = list()
  10.  
  11. for line in output:
  12.     modules.append(line.split()[0])
  13.  
  14. print modules
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement