Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Qprocess not returning the correct state()

Qprocess not returning the correct state()

Scheduled Pinned Locked Moved Unsolved General and Desktop
statestartqprocess
3 Posts 2 Posters 1.6k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    dummys
    wrote on last edited by
    #1

    Hi,

    I'm using pyqt5.
    My code:
    self.myprocess = QProcess()
    self.myprocess.start(self.mycommandline)
    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.

    1 Reply Last reply
    0
    • jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

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

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      D 1 Reply Last reply
      0
      • jsulmJ jsulm

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

        D Offline
        D Offline
        dummys
        wrote on last edited by dummys
        #3

        @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.

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved