Re: non-blocking PIPE read on Windows

2006-08-04 Thread Durumdara
Hi !Sorry, but I want to share my experiences. I hope this help to you.I think that specialized MSWindows based services too complicated. They have to many bug possibilites.So I trying with normal, "in python accessable" pipes. I see that with flush(), and some of the bintotext tricks I can use the

Re: non-blocking PIPE read on Windows

2006-08-04 Thread Paul Du Bois
placid wrote: > What i need to do is, create a process using subprocess.Popen, where > the subprocess outputs information on one line (but the info > continuesly changes and its always on the same line) and read this > information without blocking, so i can retrieve other data from the > line i rea

Re: non-blocking PIPE read on Windows

2006-07-31 Thread Durumdara
Hi !A new version with binary data handling. 103 seconds with 1000 data exchange.import os, sys, time, binascii, cPicklebpath,bname=os.path.split(sys.argv[0])def Log(Msg,IsMaster,First=False):     fn=sys.argv[0]+'.'+['c','m'][int(IsMaster)]+'.log'    mode='aw'[int(First)]    f=open(fn,mode)    f.wr

Re: non-blocking PIPE read on Windows

2006-07-31 Thread Durumdara
Hi !If you don't want to use MS-specific things, you can use the normal pipes.See this code. If you want to use non-blocking version, you need to create a thread that handle the reads/writes. import os, sys, time, binascii, cPicklebpath,bname=os.path.split(sys.argv[0])def Log(Msg,IsMaster,First=Fal

Re: non-blocking PIPE read on Windows

2006-07-30 Thread placid
Dennis Lee Bieber wrote: > On 30 Jul 2006 16:22:34 -0700, "placid" <[EMAIL PROTECTED]> declaimed the > following in comp.lang.python: > > > > > ;) Tsk Tsk > > Have you ever seen a Tempest VT-100? Lead shielding on the monitor > FACE... Turn the brightness all the way up and it still loo

Re: non-blocking PIPE read on Windows

2006-07-30 Thread placid
Dennis Lee Bieber wrote: > On 27 Jul 2006 22:26:25 -0700, "placid" <[EMAIL PROTECTED]> declaimed the > following in comp.lang.python: > > > > > readline() blocks until the newline character is read, but when i use > > read(X) where X is a number of bytes then it doesnt block(expected > > functiona

Re: non-blocking PIPE read on Windows

2006-07-29 Thread Antonio Valentino
"placid" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi all, > > I have been looking into non-blocking read (readline) operations on > PIPES on windows XP and there seems to be no way of doing this. Ive > read that you could use a Thread to read from the pipe, but if you > still

Re: non-blocking PIPE read on Windows

2006-07-28 Thread Simon Forman
placid wrote: > Hi all, > > I have been looking into non-blocking read (readline) operations on > PIPES on windows XP and there seems to be no way of doing this. Ive > read that you could use a Thread to read from the pipe, but if you > still use readline() wouldnt the Thread block too? Yes it wil

non-blocking PIPE read on Windows

2006-07-27 Thread placid
Hi all, I have been looking into non-blocking read (readline) operations on PIPES on windows XP and there seems to be no way of doing this. Ive read that you could use a Thread to read from the pipe, but if you still use readline() wouldnt the Thread block too? What i need to do is, create a proc