win32pipe question

tarnold at datacomm.ch tarnold at datacomm.ch
Sun Jul 9 07:20:03 EDT 2000


On WinNT 4.0 the following code (with SWI-prolog) works;
it writes a query to SWI-Prolog, reads the answer,
writes the next query, reads the answer and then 
halts the SWI-process.

The problem is that python seems to hang if it is waiting
for input (= output from the prolog process) and there is 
none. After exiting python the SWI-prolog process has to 
be killed by hand.

I am interested whether win32pipe only works on WinNT or
on win95/98, too.

---
  Toni Arnold


--- python code for pop2en 2 ---

from win32pipe import popen2

(plwrite,plread) = popen2('C:/Programme/pl/bin/plcon')

plwrite.write('write(abc),nl.\n')
out = plread.readline()
print out

plwrite.write('write(cde),nl.\n')
out = plread.readline()
print out

plwrite.write('halt.\nl')






More information about the Python-list mailing list