How to write a programe that include both pipe(low speed system call)and signal

Discussion in 'Python' started by Marco, Feb 15, 2007.

  1. Marco

    Marco Guest

    Hi,
    I have know that signal will interrupt some kind low speed system
    call like pipe. But how to design a program that both support signal
    and pipe?

    I have a mplayer.py to play movie via os.popen2() and mplayer
    slave mode. And there is a mplayer_ctl.py send signal to mplayer.py to
    trigger function from mplayer.py. Sometimes os.popen2() is reading or
    writing when user run mplayer_ctl.py the bad things raise...

    Is there some better way to design the programe? Thank you


    --
    LinuX Power
    Marco, Feb 15, 2007
    #1
    1. Advertising

  2. Marco

    Jordan Guest

    Re: How to write a programe that include both pipe(low speed system call) and signal

    On Feb 15, 2:51 am, Marco <> wrote:
    > Hi,
    > I have know that signal will interrupt some kind low speed system
    > call like pipe. But how to design a program that both support signal
    > and pipe?
    >
    > I have a mplayer.py to play movie via os.popen2() and mplayer
    > slave mode. And there is a mplayer_ctl.py send signal to mplayer.py to
    > trigger function from mplayer.py. Sometimes os.popen2() is reading or
    > writing when user run mplayer_ctl.py the bad things raise...
    >
    > Is there some better way to design the programe? Thank you
    >
    > --
    > LinuX Power


    Take a look at the subprocess module, which is meant to replace
    popen[1,2,3...](). Also, please try to explain the problem again,
    because I just can't decypher everything you're trying to do (and
    say).

    cheers,
    Jordan
    Jordan, Feb 15, 2007
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.

Share This Page