octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: popen2 example gives no output


From: John W. Eaton
Subject: Re: popen2 example gives no output
Date: Fri, 23 Sep 2005 23:29:28 -0400

On 23-Sep-2005, Paul Kienzle wrote:

| I wonder if there is something similar in python?  Putting a dependency 
| on python and matplotlib instead of perl and gnuplot I think would be a 
| win.  This isn't feasible yet since matplotlib doesn't support surface 
| plots.

It looks like you can write

  import errno
  for i in errno.errorcode.keys():
    errno.errorcode[i]

to generate the list of errno symbols.

Here is the perl "script" that I ended up with in src/Makefile ($
symbols are doubled because this comes out of a Makefile):

  $(PERL) -e 'foreach $$key (keys(%!)) {
    $$x .= "#if defined ($$key)\n    { \"$$key\", $$key, },\n#endif\n";
  }; while (<>) {
    s/^ address@hidden@/$$x/;
    print;
  }'

What would the same be in Python?  Can it easily go in a Makefile as a
one-liner?  If so, then we can use either Perl or Python, depending on
which is available.

jwe



reply via email to

[Prev in Thread] Current Thread [Next in Thread]