First Window in PyQt4


/ Published in: Python



Copy this code and paste it in your HTML
  1. from PyQt4 import QtGui, QtCore
  2. import sys
  3.  
  4. class Window(QtGui.QMainWindow):
  5. def __init__(self):
  6. QtGui.QMainWindow.__init__(self) #import all widgets and core functions
  7. self.resize(200,200)
  8. self.setWindowTitle('First Window')
  9.  
  10. app = QtGui.QApplication(sys.argv)
  11. main = Window()
  12. main.show()
  13. sys.exit(app.exec_()) #freeze screen

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.