Issue
I'm opening a web page in ghost.py
in IPython interactive console and showing its window to see the effect of my actions:
import ghost
s=ghost.Ghost().start()
s.open('https://google.com')
s.show()
The window shows the page's content but doesn't do anything if I try to e.g. drag or resize it, or use its scrollbars, and its title is appended with "(Not Responding)". Looks like the window's event loop is not running.
Since I'm working in the interactive console, I need the event loop to run, and do that in a background thread or something. How do I do that?
Solution
Running the %gui qt
IPython magic command before invoking ghost.Ghost().start()
does the trick.
Judging by IPython/terminal/pt_inputhooks/qt.py
, it creates a global Qt even loop and pumps events while the console is idle or something.
Answered By - ivan_pozdeev
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.