Saturday, September 28, 2013

How to load a column generated by awk into a python list

How to load a column generated by awk into a python list

With awk it is very easy to extract a column of data in the bash terminal
using.
awk '{print $1}'
I am doing this inside a python script where i use a bash sequence to
extract the data i'm interested in
os.system(" qstat | awk '{print $1}' ")
If i call this in a certain context I get a column of numbers. I would
like to load all of those numbers into a python list. Can this be done
easily?

No comments:

Post a Comment