hep needed with pipes (popen4)
Darcy Kahle
dkahle at interactdirect.com
Fri Feb 22 16:38:40 EST 2002
More information about the Python-list mailing list
Fri Feb 22 16:38:40 EST 2002
- Previous message (by thread): hep needed with pipes (popen4)
- Next message (by thread): hep needed with pipes (popen4)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
I need some help with pipes in python 2.1. I am running a comand using os.popen4(). The command produces output until the user hits control-C, at which time, it prints a summary, and exits. I want to send that character down the pipe to it without the user doing so (control-c kills the script, by default). I tried sending "\x003", which to the best of my knowledge, is the hex code for it, but it didn't work. If this is not possible, then I could do the same by redirecting the stdin to /dev/null, but if I do that at the start, the command will stop immediately. Does anyone know the correct character sequence to send control-C to the command or how to redirect the command's stdin to /dev/null after it is run? I was toying with os.dup2(), but I suspect that that will redirect the file handle inside my program to /dev/null, leaving the stdin of the command intact. I was hoping that it would link the two file handles together, thereby creating a bridge between the two. Any assistance that you can provide, will be greatly appreciated. Darcy
- Previous message (by thread): hep needed with pipes (popen4)
- Next message (by thread): hep needed with pipes (popen4)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list