objbrowser icon indicating copy to clipboard operation
objbrowser copied to clipboard

How to run browser without blocking the REPL

Open GlassGruber opened this issue 7 years ago • 2 comments

Hey there! Thank you for this, it's extremely useful!

Still I'm trying to figure out how I can run the browser without blocking the REPL, so that I can check the dumped data for what I need and go on in the REPL with the window open as a reference if I need it again.

I'm a bit naive and don't know much about QT, is it possible to launch the browser in a separate thread or something similar so to have the REPL free to continue?

Thank you for time!

GlassGruber avatar Aug 19 '18 03:08 GlassGruber

For this you have to use IPython with the %gui qt magic command to enable integration with the Qt event loop. It used to work with the regular Python prompt but I don't think it works anymore, plus IPython is much better for interactive work anyway.

So, in IPython prompt type %gui qt, or use ipython --gui=qt to start up IPython. Then start the object browser.

The '%gui' magic command makes IPython alternate quickly between processing Qt events and handling the REPL loop. There is no threading involved.

titusjan avatar Aug 19 '18 14:08 titusjan

I see thank you for your answer! I've never fiddled with IPython, guess I will start now :+1:

GlassGruber avatar Aug 21 '18 15:08 GlassGruber