I am new to Python and I need to learn it for work purposes. I am having trouble figuring out a way to use Python to replace awk for column prints.
For example, I need to print out the date: root@user:~# date Mon Jun 24 01:30:08 EDT 2013
But, I only need a certain part of it: root@user:~# date | awk '{print $2" "$3" "$4" "$5}' Jun 24 01:30:54 EDT
Is there a way in Python to do this without needing to do the following: import os os.system("date | awk '{print $2" "$3" "$4" "$5}'")
I have tried to do an extensive Google/Bing/Ask/Yahoo search and have seemed to have come up short on this.