Notice
Recent Posts
Recent Comments
Link
«   2025/06   »
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30
Tags more
Archives
Today
Total
관리 메뉴

기록

PYQT 두수의 곱 구하기 본문

PYTHON

PYQT 두수의 곱 구하기

9400 2023. 1. 2. 20:05

 

import sys
from PyQt5.QtWidgets import *
from PyQt5 import uic

form_class = uic.loadUiType("main09.ui")[0]


class WindowClass(QMainWindow, form_class) :
    def __init__(self) :
        super().__init__()
        self.setupUi(self)
        
        self.pb.clicked.connect(self.myclick)
        
    def myclick(self):
        a = self.leA.text()
        b = self.leB.text()
        aa = int(a)
        bb = int(b)
        
        self.leC.setText(str(aa*bb))
        
if __name__ == "__main__" :
    #QApplication : 프로그램을 실행시켜주는 클래스
    app = QApplication(sys.argv) 
    #WindowClass의 인스턴스 생성
    myWindow = WindowClass() 
    #프로그램 화면을 보여주는 코드
    myWindow.show()
    #프로그램을 이벤트루프로 진입시키는(프로그램을 작동시키는) 코드
    app.exec_()

출력 성공

'PYTHON' 카테고리의 다른 글

mssql python연동하여 CRUD하기  (0) 2023.01.04
PYQT 베이스볼 게임 만들기  (0) 2023.01.03
PYQT 배수의합구하기  (0) 2023.01.02
PYQT 전화번호 누르기 + QMessageBox, sender()  (0) 2023.01.02
PYQT 별찍기  (0) 2023.01.02
Comments