Python Forum

Full Version: Newbie prob
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,
I just installed PyQt4 on a Raspi and I'm totally new to both Python and Qt. I'm trying to do a Hello World - just an empty window should pop up. But instead it seems as if nothing happens.

Here is a screenshot:
[Image: bild-7f89ac-1548793246.png.html]

Any idea?
Please do not post screen shots. Instead post your code, using python tags. Here are instructions.
I posted the screenshot because the left window did a restart and I have no idea what was going on...

import sys
from PyQt4 import QtGui

app = QtGui.QApplication(sys.argv)
window = QtGui.QWidget()

window.show()
Solved it. The example was for Windows, not for Linux. It needed an additional command at the end of the code:
sys.exit(app.exec_())
Youngplayer's trap, so to speak...