Mailing List Archive

pty, qwsv and Python
Warning: NO native speaker ahead.

Hi.

I'm new to Python (only started looking at the docs yesterday). I want
to know if it is possible to control a qwsv (quake world linux server)
using Python: ie do a "status" command in the qwsv every 5 minutes,
process the returned code, watch for some string in the pty...

After searching the Python home page it looks like popen2() is the way
to go. Is it? Also, is it possible to use "screen" (a program that let
me "detach" the server) and "popen2" at the same time? I would like have
a interactive session to qwsv to do administration.

Thanks.
pty, qwsv and Python [ In reply to ]
On Fri, 16 Apr 1999 14:24:44 -0300, Henrique Almeida <palpa@bogus.bogus.com>
wrote:
>Warning: NO native speaker ahead.
>
>Hi.
>
>I'm new to Python (only started looking at the docs yesterday). I want
>to know if it is possible to control a qwsv (quake world linux server)
>using Python: ie do a "status" command in the qwsv every 5 minutes,
>process the returned code, watch for some string in the pty...
>
>After searching the Python home page it looks like popen2() is the way
>to go. Is it? Also, is it possible to use "screen" (a program that let
>me "detach" the server) and "popen2" at the same time? I would like have
>a interactive session to qwsv to do administration.
>
>Thanks.

popen2() not going to help with the infamous stdio buffering problem. What
you want is pyexpect. Look under System in
www.python.org/download/Contributed.html