Cherry and wxpython

I am trying to make a cherry application using wxpython ui. The problem is that both libraries use closed-loop event handlers. Is there any way to do this? If I have wx ui start cherrypy, is this going to block ui?

+7
python cherrypy wxpython
source share
4 answers

See my answer on CherryPy interfering with turning off Twisted on Windows

In short, CherryPy handles the main loop by default, but this is definitely not necessary. Stop using quickstart and call engine.start without engine.block, and CP will start in its threads and leave the main thread for your other structure.

+5
source share

If you use threads, you can start the CherryPy server in one thread and run wxPython in another. This article ( http://wiki.wxpython.org/LongRunningTasks ) on the wxPython wiki contains some streaming information, and the source code for the CherryPy server ( http://www.cherrypy.org/browser/trunk/cherrypy/wsgiserver/__init__ .py ) contains some documentation on how the server works, and perhaps how you could make it interact with streams.

+1
source share

One way to separate them is to run them as two separate processes and link them using some kind of IPC mechanism. You may need to write a small adapter to talk about a common protocol.

Since you are doing CherryPy, you can also provide an HTTP management interface that the wx GUI can use to manage your server.

+1
source share

I would advise you to take a look at the Caliber manager (e-book manager) source . It is written in PyQT, but uses CherryPy to allow people to browse their library from outside the local network.

+1
source share

All Articles