Python GUI with PyQT5 : Insert Button - Part 3

Опубликовано: 15 Март 2025
на канале: Computeraidedautomation.com
200
1

Python GUI with PyQT5 Insert Button
Previous tutorial code : https://computeraidedautomation.com
Code :
from PyQt5.QtWidgets import QApplication,QWidget,QPushButton
from PyQt5.QtCore import pyqtSlot
import sys
class App(QWidget):
def __init__(self):
super().__init__()
self.title='Adding Buttons to the Form'
self.left=200
self.top=200
self.width=500
self.height=500
self.initUI()
def initUI(self):
self.setWindowTitle(self.title)
self.setGeometry(self.left,self.top,self.width,self.height)
button=QPushButton('Click Here',self)
button.setToolTip('Help Text')
button.move(200,200)
self.show()
if __name__=='__main__':
app=QApplication(sys.argv)
ex=App()