capturing output of command line in an array



Hi

I am trying to execute a command using os.system. this command lists
the number of nodes alive in a cluster. I would like to capture the
output in list/array in python. IS it possible.?/

Here is my command
gstat -a
node13 2 ( 0/ 56) [ 0.00, 0.00, 0.00] [ 0.0, 0.0,
0.1, 99.9, 0.0] OFF
node12 2 ( 1/ 63) [ 0.99, 0.97, 0.91] [ 46.6, 0.0,
3.7, 49.8, 0.0] OFF
node8 2 ( 1/ 59) [ 0.99, 0.97, 0.91] [ 47.5, 0.0,
2.8, 49.7, 0.0] OFF
node2 2 ( 1/ 59) [ 0.99, 0.97, 0.91] [ 46.6, 0.0,
3.7, 49.7, 0.0] OFF
node1 2 ( 1/ 59) [ 0.99, 0.97, 0.91] [ 46.6, 0.0,
3.7, 49.7, 0.0] OFF
node7 2 ( 1/ 58) [ 0.99, 0.97, 0.91] [ 49.8, 0.0,
0.6, 49.7, 0.0] OFF
node11 2 ( 1/ 59) [ 0.99, 0.97, 0.91] [ 46.6, 0.0,
3.8, 49.6, 0.0] OFF
node4 2 ( 1/ 59) [ 1.00, 1.00, 0.93] [ 46.6, 0.0,
3.7, 49.7, 0.0] OFF
node10 2 ( 1/ 59) [ 1.00, 1.00, 0.94] [ 46.7, 0.0,
3.7, 49.7, 0.0] OFF
node5 2 ( 1/ 59) [ 1.00, 1.00, 0.92] [ 49.8, 0.0,
0.4, 49.7, 0.0] OFF
node6 2 ( 1/ 59) [ 1.00, 1.00, 0.94] [ 49.5, 0.0,
0.9, 49.7, 0.0] OFF

I would like to have an array where each element contains the nodes

for example
a=[node13,node12,node2,node8,node1,node7,node 11]

any help would be appreciated

thanks

.



Relevant Pages

  • Re: Automated Deployment Services and VSMT
    ... I put the target and master server in the same switch. ... Ran the capture and it worked fine. ... > command to return the geometry of your hard-disk. ...
    (microsoft.public.windows.server.setup)
  • Re: Catching errors in a shell scripts
    ... and `command` (incidentially I find ... doesn't capture standard error. ... to make the output escape ... Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org ...
    (Ubuntu)
  • Re: [SLE] The "cp" command is skipping files/dirs over nfs
    ... you can capture any output to a file. ... The best way I can think of for seeing it also, is to tail the capture file. ... To be able to see the stuff as it is written to the file, call the command (on ... On Wednesday 19 April 2006 10:59 am, James D. Parra wrote: ...
    (SuSE)
  • Re: Catching errors in a shell scripts
    ... and `command` (incidentially I find the ... capture standard error. ... $alloutput" mktemp generates a random filename, ... Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org ...
    (Ubuntu)
  • Re: Catching errors in a shell scripts
    ... and `command` (incidentially I find the ... capture standard error. ... $alloutput" mktemp generates a random filename, ... to make the output escape single ...
    (Ubuntu)