Re: [sage-devel] good way to see if a program exists or not from within Sage library code?

2010-03-12 Thread Dan Drake
On Fri, 12 Mar 2010 at 10:39AM +, Dr. David Kirkby wrote: > * John Palmieri has written a library function for Sage, called > "have_program()" which determines if the program exists. It does not > report it's path, as John did not need that information, but only > whether it exists or not. Exc

Re: [sage-devel] good way to see if a program exists or not from within Sage library code?

2010-03-12 Thread Dr. David Kirkby
Mike Hansen wrote: On Fri, Mar 12, 2010 at 12:09 AM, Dan Drake wrote: I'm looking over #8486 and the patch there tests to see if the xelatex program is available with os.system('which xelatex >/dev/null') See http://trac.sagemath.org/sage_trac/ticket/8474 which was just merged :-) --Mike

Re: [sage-devel] good way to see if a program exists or not from within Sage library code?

2010-03-12 Thread Mike Hansen
On Fri, Mar 12, 2010 at 12:09 AM, Dan Drake wrote: > I'm looking over #8486 and the patch there tests to see if the xelatex > program is available with > >    os.system('which xelatex >/dev/null') See http://trac.sagemath.org/sage_trac/ticket/8474 which was just merged :-) --Mike -- To post to

[sage-devel] good way to see if a program exists or not from within Sage library code?

2010-03-12 Thread Dan Drake
Hello all, I'm looking over #8486 and the patch there tests to see if the xelatex program is available with os.system('which xelatex >/dev/null') Now, the Python documentation says one should use the subprocess module instead of os.system [1], and also I recall that apparently the "which" co