I'm using the KHTMLPart component from the PyKDE (in Python) library to download some webpages in the background and return sizes of certain elements in pixels. I don't really need any visual output from this script, indeed I will probably run it on a server without X installed. The problem is that when I tell my application to run console-only like this:
app = QApplication(sys.argv, False)
my script then segfaults on the line where I initialize KHTMLPart:
browser = KHTMLPart()
Additionally, I need to set the size of the KHTML browser window to 1024x768 by calling:
browser.view.resize(1024, 768)
This doesn't seem to have any effect until I call:
browser.show()
The previous causes the browser window to appear, even if that's for a short while. I could run a simple window manager such as fluxbox on the server and it will do what I want, but I'd be much happier if it were able to function completely as a console application - if that's even possible. Is there a way to achieve this?