Executing a hidden/background program

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • jim3371@googlemail.com

    Executing a hidden/background program

    Using wxPython, I'm looking to build a GUI app for a daemon-based app,
    on Win32 platform, how would I go about executing the daemon app so it
    stays in the background when the Py app is running? It's critical that
    the child process exit when the Py app exits/crashes.
  • Mike Driscoll

    #2
    Re: Executing a hidden/background program

    Jim,

    On Sat, Nov 1, 2008 at 6:02 PM, <jim3371@google mail.comwrote:
    Using wxPython, I'm looking to build a GUI app for a daemon-based app,
    on Win32 platform, how would I go about executing the daemon app so it
    stays in the background when the Py app is running? It's critical that
    the child process exit when the Py app exits/crashes.
    --

    >
    You probably want to create a Windows service with Python. There are
    various ways to accomplish this. While I haven't done it myself, I
    found you some links:

    This is a message I posted to comp.lang.py regarding ways to run a regular Python script as a Windows service. I will assume you want to tu...




    Then the service can basically listen for input. You could probably do
    something similar by creating a local server with cherrypy or some
    such. I like the pubsub module for communication in wxPython.
    Fortunately you can use it outside of the toolkit as well:



    There's also a win32 mailing list for Python users. If you have
    specific questions about creating a service, that's probably the best
    place to ask. Here's a link to that as well:


    HTH

    Mike

    Comment

    • jim3371@googlemail.com

      #3
      Re: Executing a hidden/background program

      On Nov 2, 3:59 am, "Mike Driscoll" <kyoso...@gmail .comwrote:
      You probably want to create a Windows service with Python. There are
      various ways to accomplish this.
      Was considering a Windows service too, however would like to avoid
      that as non-Admin users may not be able to do that. While I'm not
      familiar with threading, I'm considering starting a seperate thread
      and use a function such as os.pexec that hangs until the external
      daemon .exe exists.

      Comment

      • imageguy

        #4
        Re: Executing a hidden/background program

        On Nov 2, 6:32 am, jim3...@googlem ail.com wrote:
        On Nov 2, 3:59 am, "Mike Driscoll" <kyoso...@gmail .comwrote:
        >
        You probably want to create a Windows service with Python. There are
        various ways to accomplish this.
        >
        Was considering a Windows service too, however would like to avoid
        that as non-Admin users may not be able to do that. While I'm not
        familiar with threading, I'm considering starting a seperate thread
        and use a function such as os.pexec that hangs until the external
        daemon .exe exists.
        Check out the wx.lib.delayedr esults option in the demo.

        Since wx.App needs to run as the main thread, you might be able to run
        your as the 'delayedresult' . As for the main frame of your app,
        simply Hide()/Show() when it needs to be visible. When the wx.App
        closes, the thread running the service will automatically shut down.

        Other than that ... I think it is a bit more complicated and will
        probably require asyncore and/or asynchat.
        g.

        Comment

        Working...