RE: Problem working with subprocess.check_call

2015-10-29 Thread David Aldrich
Thanks for all your answers. David -- https://mail.python.org/mailman/listinfo/python-list

Re: Problem working with subprocess.check_call

2015-10-29 Thread Laura Creighton
In a message of Thu, 29 Oct 2015 11:11:17 +0100, Laura Creighton writes: >In a message of Thu, 29 Oct 2015 09:52:56 +, David Aldrich writes: >>Hi >> >>I am working on Linux with Python 3.4. >> >>I want to do a bash diff on two text files and show just the first 20 lines >>of diff's output. So

Re: Problem working with subprocess.check_call

2015-10-29 Thread Peter Otten
David Aldrich wrote: > I am working on Linux with Python 3.4. > > I want to do a bash diff on two text files and show just the first 20 > lines of diff's output. So I tried: > cmd = 'head -20 <(diff ' + file1 + ' ' + file2 + ')' subprocess.check_call(cmd, shell=True) > > The command

Re: Problem working with subprocess.check_call

2015-10-29 Thread Laura Creighton
In a message of Thu, 29 Oct 2015 09:52:56 +, David Aldrich writes: >Hi > >I am working on Linux with Python 3.4. > >I want to do a bash diff on two text files and show just the first 20 lines of >diff's output. So I tried: > cmd = 'head -20 <(diff ' + file1 + ' ' + file2 + ')' subpr

Re: Problem working with subprocess.check_call

2015-10-29 Thread Pete Dowdell
On 29/10/15 16:52, David Aldrich wrote: Hi I am working on Linux with Python 3.4. I want to do a bash diff on two text files and show just the first 20 lines of diff’s output. So I tried: >>> cmd = 'head -20 <(diff ' + file1 + ' ' + file2 + ')' >>> subprocess.check_call(cmd, shell=True)

RE: Problem working with subprocess.check_call

2015-10-29 Thread David Aldrich
> Try this > subprocess.check_call(["bash", "-O", "extglob", "-c", cmd]) That worked. Thanks very much! David -- https://mail.python.org/mailman/listinfo/python-list

Re: Problem working with subprocess.check_call

2015-10-29 Thread INADA Naoki
On Thu, Oct 29, 2015 at 6:52 PM, David Aldrich wrote: > Hi > > > > I am working on Linux with Python 3.4. > > > > I want to do a bash diff on two text files and show just the first 20 > lines of diff’s output. So I tried: > > > > >>> cmd = 'head -20 <(diff ' + file1 + ' ' + file2 + ')' > > >>> s