martedì 21 agosto 2012

Esempio GUI con PyQt

Un esempio di GUI mediante PyQT





import sys
from PyQt4 import QtGui, QtCore

app = QtGui.QApplication(sys.argv)
widget = QtGui.QWidget()

widget.setGeometry(200, 100, 220, 120)
widget.setWindowTitle('Slider Example')

label1 = QtGui.QLabel("Valore:      ", widget)
label1.move(80, 50)

slider = QtGui.QSlider(QtCore.Qt.Horizontal, widget)
slider.setGeometry(10, 10, 200, 30)
slider.setFocusPolicy(QtCore.Qt.NoFocus)

pb = QtGui.QProgressBar(widget)
pb.setGeometry(10, 70, 215, 20)

def getValue(value):
    label1.setText("Valore: "+str(value))
    pb.setValue(value)


   
widget.connect(slider, QtCore.SIGNAL('valueChanged(int)'), getValue)



widget.show()
sys.exit(app.exec_())

Nessun commento:

Posta un commento

Physics informed neural network Fukuzono

Visto che puro ML non funziona per le serie tempo di cui mi sto occupando ed le regressioni basate su formule analitiche mostrano dei limiti...