Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Executing a hidden/background program

Reply
Thread Tools

Executing a hidden/background program

 
 
jim3371@googlemail.com
Guest
Posts: n/a
 
      11-01-2008
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.
 
Reply With Quote
 
 
 
 
Mike Driscoll
Guest
Posts: n/a
 
      11-02-2008
Jim,

On Sat, Nov 1, 2008 at 6:02 PM, <(E-Mail Removed)> wrote:
> 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.
> --
> http://mail.python.org/mailman/listinfo/python-list
>


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:

http://agiletesting.blogspot.com/200...s-windows.html
http://essiene.blogspot.com/2005/04/...-services.html
http://timgolden.me.uk/python/wmi.html

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:

http://pypi.python.org/pypi/pubsub/1%20to%203

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:
http://mail.python.org/mailman/listinfo/python-win32

HTH

Mike
 
Reply With Quote
 
 
 
 
jim3371@googlemail.com
Guest
Posts: n/a
 
      11-02-2008
On Nov 2, 3:59*am, "Mike Driscoll" <(E-Mail Removed)> wrote:
> 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.
 
Reply With Quote
 
imageguy
Guest
Posts: n/a
 
      11-03-2008
On Nov 2, 6:32*am, (E-Mail Removed) wrote:
> On Nov 2, 3:59*am, "Mike Driscoll" <(E-Mail Removed)> wrote:
>
> > 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.delayedresults 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.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
HOW this program is executing plz explain the program manish sahu C Programming 11 02-13-2010 09:07 PM
Executing a JAVA Program from a JAVA Program Shadow123 Java 0 08-11-2008 07:13 PM
Executing a DOS program from within Python Randy Kreuziger Python 1 03-16-2006 07:10 PM
executing an external program in the server side CÚdric RossÚ ASP .Net 2 09-29-2004 07:19 AM
Executing DOS (yes, DOS) program from within Python? Ben Fairbank Python 2 10-07-2003 08:51 AM



Advertisments