Need help with a program

D'Arcy J.M. Cain darcy at druid.net
Fri Jan 29 09:32:52 EST 2010


On Fri, 29 Jan 2010 11:23:54 +0200
Johann Spies <jspies at sun.ac.za> wrote:
> I know this is a python list but if you really want to get the job
> done quickly this is one method without writing python code:
> [...]
> $ grep -v 0 /tmp/y > tmp/z

There's plenty of ways to do it without writing Python.  C, C++, Perl,
Forth, Awk, BASIC, Intercal, etc.  So what?  Besides, your solution
doesn't work.  You want "grep -vw 0 /tmp/y > tmp/z" and even then it
doesn't meet the requirements.  It extracts the lines the OP wants but
doesn't reformat them.  It also assumes a Unix system or at least
something with grep installed so it isn't portable.

If you want to see how the same task can be done in many different
languages see http://www.roesler-ac.de/wolfram/hello.htm.

-- 
D'Arcy J.M. Cain <darcy at druid.net>         |  Democracy is three wolves
http://www.druid.net/darcy/                |  and a sheep voting on
+1 416 425 1212     (DoD#0082)    (eNTP)   |  what's for dinner.



More information about the Python-list mailing list