pexpect question....

draghuram at gmail.com draghuram at gmail.com
Fri Jul 1 12:44:49 EDT 2005


Hi,

I am using pexpect to spawn an interactive program and wait for
particular string in its output. It works fine but once I get this
required information, I really don't care about the child process
anymore. I would effectively want to "detach" from it. Is there any way
to do such thing in pexpect? I did read pexpect's doc but couldn't find
any information in this regard. Currently, I am spawning a new thread
that just does pexpect_spawned_child.close(wait=1). It seems to work in
some cases but the child process is occassionally getting deadlocked.

# strace -p 23159
Process 23159 attached - interrupt to quit
write(2, "H_235J  Task 4 being run as INCR"..., 72 <unfinished ...>

It just sits there indefinitely. Python is 2.3.3 and the OS is SuSe
9.1. 

Thanks,
Raghu.




More information about the Python-list mailing list