Re: asyncio subprocess PIPE output lost

2014-08-20 Thread Mark Lawrence
On 20/08/2014 05:04, yuzhichang wrote: Would you please access this list via https://mail.python.org/mailman/listinfo/python-list or read and action this https://wiki.python.org/moin/GoogleGroupsPython to prevent us seeing double line spacing and single line paragraphs, thanks. -- My fellow

Re: asyncio subprocess PIPE output lost

2014-08-19 Thread yuzhichang
On Wednesday, August 20, 2014 1:08:17 AM UTC+8, Kushal Kumaran wrote: > On Tue, Aug 19, 2014 at 1:09 PM, yuzhichang wrote: > > > Hi all, > > > I'm new to asyncio introduced by Python 3.4. I created two tasks each > > pings a host. I noticed some pieces of output will be lost(see "error: >

Re: asyncio subprocess PIPE output lost

2014-08-19 Thread Kushal Kumaran
On Tue, Aug 19, 2014 at 1:09 PM, yuzhichang wrote: > Hi all, > I'm new to asyncio introduced by Python 3.4. I created two tasks each > pings a host. I noticed some pieces of output will be lost(see "error: found > icmp_seq gap"). If I changed to run only one task, this problem never occur. >

asyncio subprocess PIPE output lost

2014-08-19 Thread yuzhichang
2 ms\n' got line: b'64 bytes from tyr.global.tektronix.net (10.250.163.252): icmp_seq=10 ttl=55 time=192 ms\n' got line: b'64 bytes from tyr.global.tektronix.net (10.250.163.252): icmp_seq=11 ttl=55 time=210 ms\n' got line: b'64 bytes from babylon.rich.tek.com (10.2

Re: Second try: non-blocking subprocess pipe and Tkinter in 2.7

2012-12-21 Thread Terry Reedy
which underlies Tkinter, supports non-blocking, asynchronous reading out of the box. Apparently it does not. There is currently the asyncore module, but I don't know that anyone really likes it. So, my question is hereby revised as such: how can I implement a non-blocking read of a subpr

Re: Second try: non-blocking subprocess pipe and Tkinter in 2.7

2012-12-21 Thread Peter Otten
ch underlies Tkinter, > supports non-blocking, asynchronous reading out of the box. Apparently > it does not. > > So, my question is hereby revised as such: how can I implement a > non-blocking read of a subprocess pipe that can write data to the > Tkinter text widget in an manner

Second try: non-blocking subprocess pipe and Tkinter in 2.7

2012-12-21 Thread Kevin Walzer
-blocking, asynchronous reading out of the box. Apparently it does not. So, my question is hereby revised as such: how can I implement a non-blocking read of a subprocess pipe that can write data to the Tkinter text widget in an manner that does not cause the GUI to lock up? --Kevin -- Kevin

Re: subprocess pipe question

2011-02-25 Thread Rita
The results look right! I did a rather large test and the checksum passed. I will hold off any speed ups as you suggested. On Wed, Feb 23, 2011 at 8:37 PM, Rob Williscroft wrote: > Rita wrote in > news:AANLkTi=88dcpm_kqrs2g620obsnxz0majubfwpeme...@mail.gmail.com in > gmane.comp.python.general:

Re: subprocess pipe question

2011-02-23 Thread Rob Williscroft
Rita wrote in news:AANLkTi=88dcpm_kqrs2g620obsnxz0majubfwpeme...@mail.gmail.com in gmane.comp.python.general: [Top post relocated] > On Tue, Feb 22, 2011 at 7:57 PM, Rob Williscroft > wrote: > >> Rita wrote in >> news:AANLkTi=w95gxosc1tkt2bntgjqys1cbmdnojhokq4...@mail.gmail.com in >> gmane.co

Re: subprocess pipe question

2011-02-23 Thread Rita
This is a good solution thanks. You should wiki this somewhere. For extra points is there a way to speed up the p.stdout.read(bufsize) ? On Tue, Feb 22, 2011 at 7:57 PM, Rob Williscroft wrote: > Rita wrote in > news:AANLkTi=w95gxosc1tkt2bntgjqys1cbmdnojhokq4...@mail.gmail.com in > gmane.comp.

Re: subprocess pipe question

2011-02-22 Thread Rita
Thanks everyone for your replies. Chris, Unfortunately, I can't redirect the output to a file because there are other processes which use this processes output as stdin. Rob, I will give this a try. On Tue, Feb 22, 2011 at 7:48 PM, Chris Kaynor wrote: > > On Tue, Feb 22, 2011 at 3:44 PM, Rita

Re: subprocess pipe question

2011-02-22 Thread Rob Williscroft
Rita wrote in news:AANLkTi=w95gxosc1tkt2bntgjqys1cbmdnojhokq4...@mail.gmail.com in gmane.comp.python.general: > > When using wait() it works a bit better but not consistent > def run(cmd): > p=subprocess.Popen(cmd,stdout=subprocess.PIPE) > rc=p.wait() > print rc > return p.stdout > > W

Re: subprocess pipe question

2011-02-22 Thread Chris Kaynor
On Tue, Feb 22, 2011 at 3:44 PM, Rita wrote: > I have a process like this, > > def run(cmd): > #cmd=a process which writes a lot of data. Binary/ASCII data > p=subprocess.Popen(cmd,stdout=subprocess.PIPE) > > I would like to get cmd's return code so I am doing this, > > def run(cmd): > p=su

Re: subprocess pipe question

2011-02-22 Thread GMail Felipe
On 22/02/2011, at 20:44, Rita wrote: > I have a process like this, > > def run(cmd): > #cmd=a process which writes a lot of data. Binary/ASCII data > p=subprocess.Popen(cmd,stdout=subprocess.PIPE) > > I would like to get cmd's return code so I am doing this, > > def run(cmd): > p=subpro

subprocess pipe question

2011-02-22 Thread Rita
I have a process like this, def run(cmd): #cmd=a process which writes a lot of data. Binary/ASCII data p=subprocess.Popen(cmd,stdout=subprocess.PIPE) I would like to get cmd's return code so I am doing this, def run(cmd): p=subprocess.Popen(cmd,stdout=subprocess.PIPE) rc=p.poll() print

Re: subprocess pipe

2010-11-15 Thread Nobody
On Sun, 14 Nov 2010 19:47:55 +, Tim Harig wrote: > On 2010-11-14, Camille Harang wrote: >> # pg_dump prompts for password so I inject it in stdin. >> pgsql.stdin.write('MY_PASSWORD' + '\n') > > For security reasons, some programs use direct access to the TTY system > for password entry rathe

Re: subprocess pipe

2010-11-14 Thread Camille Harang
Tim Harig a écrit : > On 2010-11-14, Camille Harang wrote: >> # pg_dump prompts for password so I inject it in stdin. >> pgsql.stdin.write('MY_PASSWORD' + '\n') > > For security reasons, some programs use direct access to the TTY system > for password entry rather then reading from stdin. Most o

Re: subprocess pipe

2010-11-14 Thread Camille Harang
Tim Harig a écrit : > On 2010-11-14, Camille Harang wrote: >> # pg_dump prompts for password so I inject it in stdin. >> pgsql.stdin.write('MY_PASSWORD' + '\n') > > For security reasons, some programs use direct access to the TTY system > for password entry rather then reading from stdin. Most o

Re: subprocess pipe

2010-11-14 Thread Tim Harig
On 2010-11-14, Tim Harig wrote: > On 2010-11-14, Camille Harang wrote: >> # pg_dump prompts for password so I inject it in stdin. >> pgsql.stdin.write('MY_PASSWORD' + '\n') > > For security reasons, some programs use direct access to the TTY system > for password entry rather then reading from st

Re: subprocess pipe

2010-11-14 Thread Tim Harig
On 2010-11-14, Camille Harang wrote: > # pg_dump prompts for password so I inject it in stdin. > pgsql.stdin.write('MY_PASSWORD' + '\n') For security reasons, some programs use direct access to the TTY system for password entry rather then reading from stdin. Most of these programs provide anoth

Re: subprocess pipe

2010-11-14 Thread Camille Harang
Hi Chris, thanks for your reply. Chris Rebert a écrit : > Quoting http://docs.python.org/library/subprocess.html , emphasis mine: > """ > On Unix, with shell=True: [...] If args is a sequence, ***the first > item*** specifies the command string, and any additional items will be > treated as additi

Re: subprocess pipe

2010-11-14 Thread Chris Rebert
On Sun, Nov 14, 2010 at 10:50 AM, Camille Harang wrote: > Hi all, > > I'm having a problem with subprocess.Popen. It seems that its unable to > capture the pg_dump's standard inputs & outputs in a non-shell mode: > > from subprocess import Popen, PIPE > > # fire pg_dump in order to read data from

subprocess pipe

2010-11-14 Thread Camille Harang
Hi all, I'm having a problem with subprocess.Popen. It seems that its unable to capture the pg_dump's standard inputs & outputs in a non-shell mode: from subprocess import Popen, PIPE # fire pg_dump in order to read data from the file object pgsql.stdout pgsql = Popen(['/usr/bin/pg_dump',