import subprocess as sp
obj=sp.Popen('softwareupdate --history',stdin=sp.PIPE,stdout=sp.PIPE,shell=True)
print obj.communicate()[0]