Split Output of Unix who Command (rewho.py) : Split : Regular Expressions PYTHON TUTORIALS


PYTHON TUTORIALS » Regular Expressions » Split »

 

Split Output of Unix who Command (rewho.py)


from os import popen
import re


f = popen('who', 'r')
for eachLine in f.readlines():
   print split('ss+|t', eachLine.strip())
f.close()



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON TUTORIALS

 Navioo Regular Expressions
» Split