Qprocess not returning the correct state()

  • Hi,

    I'm using pyqt5.
    My code:
    self.myprocess = QProcess()
    print self.myprocess.state()

    When I ps -aux I see the process has been launched and is working but when I call the state() method it returns 0.
    When the process start I get a "1" but after I get a 0.
    Several other process is launched correctly with this technics and I get "2" in the state.
    what can I do to debug this issue ?
    Thanks for help.

  • Qt Champions 2018

    Did you try to use absolute path to the ps command?
    Like: "/bin/ps -aux"

  • @jsulm Hmm I'm not trying to launch ps... I launch /usr/bin/asterisk. I do the ps in a terminal just to check if the process has been created and is running.

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.