I have a very simple awk command running within subprocess call; it does exactly what I want in terms of printing the data within $1
import subprocess
subprocess.call("awk '{print $1}' textfile.txt")
However, what I'd like to do is work with the data contained within $1. Is there a way that I can pass the result back in to Python?
Or would it be better to do this directly within Python? If so, this is where I'm not finding what I'm looking for in terms of printing text file columns in as simple a way as awk. Any pointers would be much appreciated, thank you.