썬글라스가 잘 어울리는 개발고미
DEV on the Beach
썬글라스가 잘 어울리는 개발고미
전체 방문자
오늘
어제
  • 분류 전체보기 (83)
    • 공부 기록노트 (7)
      • React (3)
      • java (15)
      • !오류 (1)
      • html css (1)
      • javascript (11)
      • JSP (4)
      • python (16)
      • network (0)
      • Oracle (6)
      • Git (1)
      • 정보처리기사 (4)
      • plug-in (1)
      • 프로그램 설치 (0)
      • Spring (0)
      • CS (0)
    • 신기술 동향 (0)
    • 맛집 카페 리뷰 (3)

블로그 메뉴

  • 홈
  • 태그
  • 방명록

공지사항

인기 글

태그

  • 프로그래머스문제풀이
  • 제이쿼리
  • ArrayList
  • Collection Framework
  • 핸드드립
  • 리액트
  • 파이썬
  • java
  • JSP
  • 혼공

최근 댓글

최근 글

티스토리

hELLO · Designed By 정상우.
썬글라스가 잘 어울리는 개발고미

DEV on the Beach

공부 기록노트/python

[python]day4. 파이큐티(pyQt5) - 배수의 합 구하기

2023. 1. 3. 19:55
import sys

from PyQt5 import uic
from PyQt5.QtWidgets import QMainWindow, QApplication, QMessageBox
from PyQt5.Qt import QLabel


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

class MyWindow(QMainWindow, form_class):
     
    def __init__(self):
        super().__init__()
        self.setupUi(self)
        self.pb.clicked.connect(self.myclick)

        
    def myclick(self):
        print("hello")
        a = self.leA.text()
        b = self.leB.text()
        c = self.leC.text()
        
        aa= int(a)
        bb= int(b)
        cc= int(c)
        
        print(aa,bb,cc)
        
        sum=0
        for i in range(aa,bb+1):
            if(i%cc==0):
                sum+= i
                print(i)
        print(sum)
        self.leD.setText(str(sum))
        

if __name__ == "__main__":
    app = QApplication(sys.argv)
    myWindow = MyWindow()
    myWindow.show()
    app.exec_()

main0a.ui

더보기
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
 <class>MainWindow</class>
 <widget class="QMainWindow" name="MainWindow">
  <property name="geometry">
   <rect>
    <x>0</x>
    <y>0</y>
    <width>636</width>
    <height>670</height>
   </rect>
  </property>
  <property name="windowTitle">
   <string>MainWindow</string>
  </property>
  <widget class="QWidget" name="centralwidget">
   <widget class="QLineEdit" name="leA">
    <property name="geometry">
     <rect>
      <x>100</x>
      <y>50</y>
      <width>61</width>
      <height>31</height>
     </rect>
    </property>
   </widget>
   <widget class="QLineEdit" name="leB">
    <property name="geometry">
     <rect>
      <x>220</x>
      <y>50</y>
      <width>61</width>
      <height>31</height>
     </rect>
    </property>
   </widget>
   <widget class="QLineEdit" name="leC">
    <property name="geometry">
     <rect>
      <x>340</x>
      <y>50</y>
      <width>61</width>
      <height>31</height>
     </rect>
    </property>
   </widget>
   <widget class="QLineEdit" name="leD">
    <property name="geometry">
     <rect>
      <x>480</x>
      <y>50</y>
      <width>61</width>
      <height>31</height>
     </rect>
    </property>
   </widget>
   <widget class="QLabel" name="lbl1">
    <property name="geometry">
     <rect>
      <x>170</x>
      <y>60</y>
      <width>56</width>
      <height>12</height>
     </rect>
    </property>
    <property name="text">
     <string>에서</string>
    </property>
   </widget>
   <widget class="QLabel" name="lbl2">
    <property name="geometry">
     <rect>
      <x>290</x>
      <y>60</y>
      <width>56</width>
      <height>12</height>
     </rect>
    </property>
    <property name="text">
     <string>까지</string>
    </property>
   </widget>
   <widget class="QPushButton" name="pb">
    <property name="geometry">
     <rect>
      <x>420</x>
      <y>50</y>
      <width>51</width>
      <height>31</height>
     </rect>
    </property>
    <property name="text">
     <string>배수합</string>
    </property>
   </widget>
  </widget>
  <widget class="QMenuBar" name="menubar">
   <property name="geometry">
    <rect>
     <x>0</x>
     <y>0</y>
     <width>636</width>
     <height>21</height>
    </rect>
   </property>
  </widget>
  <widget class="QStatusBar" name="statusbar"/>
 </widget>
 <resources/>
 <connections/>
</ui>

'공부 기록노트 > python' 카테고리의 다른 글

[python]day6. MSSQL - SELECT/INSERT/UPDATE/DELETE  (0) 2023.01.04
[python]day4. 파이큐티(pyQt5) - baseball 게임  (0) 2023.01.03
[python]day4. 파이큐티(pyQt5) - 곱하기 연산  (0) 2023.01.03
[python]day4. 파이큐티(pyQt5) - 전화번호 찍기  (0) 2023.01.03
[python]day4. 파이큐티(pyQt5) - 별 찍기  (1) 2023.01.03
    '공부 기록노트/python' 카테고리의 다른 글
    • [python]day6. MSSQL - SELECT/INSERT/UPDATE/DELETE
    • [python]day4. 파이큐티(pyQt5) - baseball 게임
    • [python]day4. 파이큐티(pyQt5) - 곱하기 연산
    • [python]day4. 파이큐티(pyQt5) - 전화번호 찍기
    썬글라스가 잘 어울리는 개발고미
    썬글라스가 잘 어울리는 개발고미

    티스토리툴바