[PyKDE] Interfacing PyQt to non-Qt python

Jeremy Sanders jeremy at jeremysanders.net
Sat Feb 5 20:13:22 GMT 2005


Hi -

I'd like to allow non-PyQt python programs to access some of my 
application's functionality.

I'd like normal python code to send instructions to my PyQt window, which 
would then update. This would be mostly 1-way, so it would say something 
like "Show a graph with this data".

The main problem is that there has to be a QApplication, which means a 
"normal" python program can't just control my window.

The only way around this I can think of is to run my code as a separate 
application. The controlling application would then convert everything to 
text commands, send it over a pipe or some other RPC interface.

Another possibility is to run the QApplication in a separate thread, and 
somehow send the commands between the two threads.

The pipe interface sounds definitely workable, if messy and slow 
(possibly quite a lot of data needs to be transported to the PyQt code). 
I've no idea whether the threading idea could work.

Does anyone have any suggestions? Would threading work?

Thanks

Jeremy

-- 
Jeremy Sanders <jeremy at jeremysanders.net>
http://www.jeremysanders.net/                Cambridge, UK
Public Key Server PGP Key ID: E1AAE053




More information about the PyQt mailing list