Monday 18 March 2024

Simplest Python interaction app for neural networks

 Making artificial neural networks is not enough by itself. You have to package them in a standalone application like Qt or a Web application. Here is the simplest (working) Python Qt app:

 

# -*- coding: utf-8 -*-

"""

Created on Mon Mar 18 16:08:42 2024

@author: ars

"""

import sys

from PyQt5.QtWidgets import QApplication, QWidget, QPushButton, QMessageBox

class MyApp(QWidget):

def init(self):

super().__init__()

self.initUI()

def initUI(self):

self.setGeometry(100, 100, 300, 200)

self.setWindowTitle('Simple App')

self.button = QPushButton('Click me', self)

self.button.setGeometry(100, 100, 100, 50)

self.button.clicked.connect(self.showMessageBox)

self.show()

def showMessageBox(self):

QMessageBox.information(self, 'Message', 'Button clicked!')

if name == '__main__':

app = QApplication(sys.argv)

ex = MyApp()

sys.exit(app.exec_())