from os import popenimport ref = popen('who', 'r')for eachLine in f.readlines(): print split('\s\s+|\t', eachLine.strip())f.close()