how to get output from system call into data object
Stephen M. Shelly
stephen at tocol.chc.us.ac.com
Fri Aug 27 13:24:08 EDT 1999
I am still VERY new to python, and I have a pretty ugly logical
problem to solve. I have tried using perl, but it is very nasty
looking when I try to use multi-dimensional arrays. I need to run
a command which will return data in column format, I want to extract
particular columns into data structures that I can then manipulate.
I currently have:
import os
system("my_command | awk {'print $What $I $ Need'}")
i would like to fill a list of objects with this output, but I
do not know how......
I know this is not what I should be doing, but I do not have a
good enough understanding of python to figure out how to create
my list of data objects
from this output.
is it like:
MyList = system("Command | awk {print what i need}") ??????????
As always, any and all assistance is rewarded in the afterlife as
well as with my deepest gratitude.
PEACE
More information about the Python-list
mailing list