python popen skip first line


for i in list(os.popen('ps -elF'))[1:]:
print i,
....:

4 S root 1 0 0 80 0 – 2937 wait 1928 2 07:48 ? 00:00:00 /bin/bash
4 S root 14 0 0 80 0 – 2937 n_tty_ 2212 3 08:47 ? 00:00:00 bash
4 S root 301 1 0 80 0 – 54176 pipe_w 24864 2 17:17 ? 00:00:00 /usr/bin/python /usr/bin/ipython
0 Z root 308 301 0 80 0 – 0 exit 0 0 17:19 ? 00:00:00
0 Z root 309 301 0 80 0 – 0 exit 0 3 17:20 ? 00:00:00
0 R root 319 301 0 80 0 – 4939 – 2064 3 17:51 ? 00:00:00 ps -elF

Leave a Reply

Your email address will not be published. Required fields are marked *