Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Newbie prob
#1
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?
Reply
#2
Please do not post screen shots. Instead post your code, using python tags. Here are instructions.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply
#3
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()
Reply
#4
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...
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  .exe prob Kundan 9 3,097 Nov-12-2020, 05:12 AM
Last Post: Kundan

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020