Python Gui | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Python Gui

im using PyQt4 to create a GUI but nothing is happening when i run the program Here is my code import sys from PyQt4 import QtGui class Example(QtGui.QWidget): def __init__(self): super(Example,self). init() self.initUI() def initUI(self): jp1 = QtGui.QLabel("Jimobho", self) jp1.move(15,10) jp2 = QtGui.QLabel("Andro", self) jp2.move(35,40) jp3 = QtGui.QLabel("Alan", self) jp3.move(55,70) self.setGeometry(300,300,250,150) self.setWindowTitle("Absolute") self.show() def main(): app =QtGui.QApplication(sys.argv) ex = Example() sys.exit(app.exec_()) if __name__ == 'main': main()

26th Oct 2018, 6:50 PM
james z phiri
james z phiri - avatar
1 Answer
+ 5
if __name__ == '__main__':
26th Oct 2018, 7:26 PM
Mert Yazıcı
Mert Yazıcı - avatar