Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import sys
- from PyQt5 import QtWidgets, QtGui
- from PyQt5.QtWidgets import QApplication, QWidget,QPushButton,QAction,QLineEdit,QMessageBox,QLabel,QComboBox
- from PyQt5.QtGui import QIcon
- from PyQt5.QtCore import pyqtSlot
- def Okna(numer):
- if numer==1:
- if __name__=='__main__':
- app=QApplication(sys.argv)
- ex=App()
- ex.show()
- sys.exit(app.exec_())
- if numer==2:
- if __name__=='__main__':
- app=QApplication(sys.argv)
- ex=Prostokaty()
- ex.show()
- sys.exit(app.exec_())
- if numer==3:
- if __name__=='__main__':
- app=QApplication(sys.argv)
- ex=Trapezy()
- ex.show()
- sys.exit(app.exec_())
- if numer==3:
- if __name__=='__main__':
- app=QApplication(sys.argv)
- ex=MonteCarlo()
- ex.show()
- sys.exit(app.exec_())
- if numer==4:
- if __name__=='__main__':
- app=QApplication(sys.argv)
- ex=Simpson()
- ex.show()
- sys.exit(app.exec_())
- class Prostokaty(QWidget):
- def __init__(self):
- super().__init__()
- self.title='Liczenie Całek Różnymi Metodami'
- self.left=100
- self.top=100
- self.width=640
- self.height=480
- self.initUI()
- def initUI(self):
- self.setWindowTitle(self.title)
- self.setGeometry(self.left,self.top,self.width,self.height)
- label = QLabel('Metoda Prostokątów',self)
- label.move(190,40)
- label.setFont(QtGui.QFont("Times", 16, QtGui.QFont.Bold))
- Funkcja = QLabel('Funkcja',self)
- Funkcja.move(50,160)
- Funkcja.setFont(QtGui.QFont("Times", 12, QtGui.QFont.Bold))
- A = QLabel('Początek przedziału',self)
- A.move(50,200)
- A.setFont(QtGui.QFont("Times", 12, QtGui.QFont.Bold))
- B = QLabel('Koniec przedziału',self)
- B.move(50,240)
- B.setFont(QtGui.QFont("Times", 12, QtGui.QFont.Bold))
- Krok = QLabel('Krok ',self)
- Krok.move(50,280)
- Krok.setFont(QtGui.QFont("Times", 12, QtGui.QFont.Bold))
- sposób = QLabel('Sposób pomiarów',self)
- sposób.move(50,320)
- sposób.setFont(QtGui.QFont("Times", 12, QtGui.QFont.Bold))
- textboxFunkcja = QLineEdit(self)
- textboxFunkcja.move(300,151)
- textboxFunkcja.resize(200,36)
- textboxA = QLineEdit(self)
- textboxA.move(300,191)
- textboxA.resize(200,36)
- textboxB = QLineEdit(self)
- textboxB.move(300,231)
- textboxB.resize(200,36)
- textboxKrok = QLineEdit(self)
- textboxKrok.move(300,271)
- textboxKrok.resize(200,36)
- comboBoxsposób = QComboBox(self)
- comboBoxsposób.addItem("Prawo")
- comboBoxsposób.addItem("Lewo")
- comboBoxsposób.addItem("Środek")
- comboBoxsposób.move(300,311)
- comboBoxsposób.resize(200,36)
- comboBoxsposób.setStyleSheet('background-color: white;')
- comboBoxsposób.setFont(QtGui.QFont("Times", 12, QtGui.QFont.Bold))
- ObliczP=QPushButton('Oblicz',self)
- #ObliczP.clicked.connect()
- ObliczP.move(50,380)
- ObliczP.setFont(QtGui.QFont("Times", 12, QtGui.QFont.Bold))
- ObliczP.resize(100,36)
- self.show()
- class Trapezy(QWidget):
- def __init__(self):
- super().__init__()
- self.title='Liczenie Całek Różnymi Metodami'
- self.left=100
- self.top=100
- self.width=640
- self.height=480
- self.initUI()
- def initUI(self):
- self.setWindowTitle(self.title)
- self.setGeometry(self.left,self.top,self.width,self.height)
- label = QLabel('Metoda Trapezów',self)
- label.move(190,40)
- label.setFont(QtGui.QFont("Times", 16, QtGui.QFont.Bold))
- Funkcja = QLabel('Funkcja',self)
- Funkcja.move(50,160)
- Funkcja.setFont(QtGui.QFont("Times", 12, QtGui.QFont.Bold))
- A = QLabel('Początek przedziału',self)
- A.move(50,200)
- A.setFont(QtGui.QFont("Times", 12, QtGui.QFont.Bold))
- B = QLabel('Koniec przedziału',self)
- B.move(50,240)
- B.setFont(QtGui.QFont("Times", 12, QtGui.QFont.Bold))
- Krok = QLabel('Krok ',self)
- Krok.move(50,280)
- Krok.setFont(QtGui.QFont("Times", 12, QtGui.QFont.Bold))
- textboxFunkcja = QLineEdit(self)
- textboxFunkcja.move(300,151)
- textboxFunkcja.resize(200,36)
- textboxA = QLineEdit(self)
- textboxA.move(300,191)
- textboxA.resize(200,36)
- textboxB = QLineEdit(self)
- textboxB.move(300,231)
- textboxB.resize(200,36)
- textboxKrok = QLineEdit(self)
- textboxKrok.move(300,271)
- textboxKrok.resize(200,36)
- ObliczT=QPushButton('Oblicz',self)
- #ObliczT.clicked.connect()
- ObliczT.move(50,380)
- ObliczT.setFont(QtGui.QFont("Times", 12, QtGui.QFont.Bold))
- ObliczT.resize(100,36)
- self.show()
- class MonteCarlo(QWidget):
- def __init__(self):
- super().__init__()
- self.title='Liczenie Całek Różnymi Metodami'
- self.left=100
- self.top=100
- self.width=640
- self.height=480
- self.initUI()
- def initUI(self):
- self.setWindowTitle(self.title)
- self.setGeometry(self.left,self.top,self.width,self.height)
- label = QLabel('Metoda MonteCarlo',self)
- label.move(190,40)
- label.setFont(QtGui.QFont("Times", 16, QtGui.QFont.Bold))
- Funkcja = QLabel('Funkcja',self)
- Funkcja.move(50,160)
- Funkcja.setFont(QtGui.QFont("Times", 12, QtGui.QFont.Bold))
- A = QLabel('Początek przedziału',self)
- A.move(50,200)
- A.setFont(QtGui.QFont("Times", 12, QtGui.QFont.Bold))
- B = QLabel('Koniec przedziału',self)
- B.move(50,240)
- B.setFont(QtGui.QFont("Times", 12, QtGui.QFont.Bold))
- Krok = QLabel('Krok ',self)
- Krok.move(50,280)
- Krok.setFont(QtGui.QFont("Times", 12, QtGui.QFont.Bold))
- textboxFunkcja = QLineEdit(self)
- textboxFunkcja.move(300,151)
- textboxFunkcja.resize(200,36)
- textboxA = QLineEdit(self)
- textboxA.move(300,191)
- textboxA.resize(200,36)
- textboxB = QLineEdit(self)
- textboxB.move(300,231)
- textboxB.resize(200,36)
- textboxKrok = QLineEdit(self)
- textboxKrok.move(300,271)
- textboxKrok.resize(200,36)
- ObliczM=QPushButton('Oblicz',self)
- #ObliczM.clicked.connect()
- ObliczM.move(50,380)
- ObliczM.setFont(QtGui.QFont("Times", 12, QtGui.QFont.Bold))
- ObliczM.resize(100,36)
- self.show()
- class Simpson(QWidget):
- def __init__(self):
- super().__init__()
- self.title='Liczenie Całek Różnymi Metodami'
- self.left=100
- self.top=100
- self.width=640
- self.height=480
- self.initUI()
- def initUI(self):
- self.setWindowTitle(self.title)
- self.setGeometry(self.left,self.top,self.width,self.height)
- label = QLabel('Metoda Simpsona',self)
- label.move(190,40)
- label.setFont(QtGui.QFont("Times", 16, QtGui.QFont.Bold))
- Funkcja = QLabel('Funkcja',self)
- Funkcja.move(50,160)
- Funkcja.setFont(QtGui.QFont("Times", 12, QtGui.QFont.Bold))
- A = QLabel('Początek przedziału',self)
- A.move(50,200)
- A.setFont(QtGui.QFont("Times", 12, QtGui.QFont.Bold))
- B = QLabel('Koniec przedziału',self)
- B.move(50,240)
- B.setFont(QtGui.QFont("Times", 12, QtGui.QFont.Bold))
- Krok = QLabel('Krok ',self)
- Krok.move(50,280)
- Krok.setFont(QtGui.QFont("Times", 12, QtGui.QFont.Bold))
- textboxFunkcja = QLineEdit(self)
- textboxFunkcja.move(300,151)
- textboxFunkcja.resize(200,36)
- textboxA = QLineEdit(self)
- textboxA.move(300,191)
- textboxA.resize(200,36)
- textboxB = QLineEdit(self)
- textboxB.move(300,231)
- textboxB.resize(200,36)
- textboxKrok = QLineEdit(self)
- textboxKrok.move(300,271)
- textboxKrok.resize(200,36)
- ObliczS=QPushButton('Oblicz',self)
- #ObliczS.clicked.connect()
- ObliczS.move(50,380)
- ObliczS.setFont(QtGui.QFont("Times", 12, QtGui.QFont.Bold))
- ObliczS.resize(100,36)
- self.show()
- class App(QWidget):
- def on_prosto(self):
- child = Prostokaty()
- child.show()
- self.children.append(child)
- def on_trapez(self):
- child = Trapezy()
- child.show()
- self.children.append(child)
- def on_mc(self):
- child = MonteCarlo()
- child.show()
- self.children.append(child)
- def on_sim(self):
- child = Simpson()
- child.show()
- self.children.append(child)
- def __init__(self):
- super().__init__()
- self.title='Liczenie Całek Różnymi Metodami'
- self.left=100
- self.top=100
- self.width=640
- self.height=480
- self.initUI()
- def initUI(self):
- self.setWindowTitle(self.title)
- self.setGeometry(self.left,self.top,self.width,self.height)
- label = QLabel('Wybierz metode obliczania całek',self)
- label.move(150,40)
- label.setFont(QtGui.QFont("Times", 16, QtGui.QFont.Bold))
- Prosto=QPushButton('Metoda Prostokątów',self)
- Prosto.clicked.connect(self.on_prosto)
- self.children = []
- Prosto.move(50,160)
- Prosto.setFont(QtGui.QFont("Times", 12, QtGui.QFont.Bold))
- Trapez=QPushButton('Metoda Trapezów',self)
- Trapez.clicked.connect(self.on_trapez)
- self.children = []
- Trapez.move(50,200)
- Trapez.setFont(QtGui.QFont("Times", 12, QtGui.QFont.Bold))
- MonteCarlo=QPushButton('Metoda MonteCarlo',self)
- MonteCarlo.clicked.connect(self.on_mc)
- self.children = []
- MonteCarlo.move(50,240)
- MonteCarlo.setFont(QtGui.QFont("Times", 12, QtGui.QFont.Bold))
- Simpson=QPushButton('Metoda Simpsona',self)
- Simpson.clicked.connect(self.on_sim)
- self.children = []
- Simpson.move(50,280)
- Simpson.setFont(QtGui.QFont("Times", 12, QtGui.QFont.Bold))
- self.show()
- Okna(1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement