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 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
| from PyQt5 import QtCore
from PyQt5.QtWidgets import *
from PyQt5.QtCore import *
from PyQt5.QtGui import *
import os,sys
import numpy as np
from pylab import *
class fenPrincipale(QMainWindow):
def __init__(self):
QMainWindow.__init__(self)
fenetre_widget = QWidget()
self.table_considere=QSpinBox()
self.table_considere.setRange(2,50)
self.nb_points=QSpinBox()
self.nb_points.setRange(3, 350)
LayoutV=QVBoxLayout()
LayoutV.addWidget(self.table_considere)
LayoutV.addWidget(self.nb_points)
fenetre_widget.setLayout(LayoutV)
self.setCentralWidget(fenetre_widget)
self.nb_points.valueChanged.connect(self.dessin_graphique)
self.table_considere.valueChanged.connect(self.representation_table)
def dessin_graphique(self,theta,y):
self.initialisation
print(theta*x*y)
def representation_table(self,theta):
self.initialisation
print((theta*x)/y)
def initialisation(self,x,y):
theta = 10
x = 3
y = 2
def main(args):
appli=QApplication(args)
fenetre=fenPrincipale()
fenetre.show()
r=appli.exec_()
return r
if __name__=="__main__":
main(sys.argv) |
Partager