-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
39 lines (33 loc) · 1.1 KB
/
main.py
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
from PyQt5 import QtWidgets, uic, QtGui
from PyQt5.QtWidgets import QWidget, QDialog
from plot import plot
from PyQt5.QtWidgets import*
from PyQt5.QtGui import *
from PyQt5.QtCore import *
import sys
from PyQt5.QtWidgets import QMessageBox
def PopUpMessage(self, error_message):
QMessageBox.critical(self, "Error", error_message)
class UI(QDialog):
def __init__(self):
super(UI, self).__init__()
uic.loadUi('plloter.ui', self)
self.button1.clicked.connect(self.sketch)
def sketch(self):
try:
o=plot(self.lineEdit_3.text(), self.lineEdit.text(), self.lineEdit_2.text())
o.plotFunction()
except ValueError as ve:
err_message = ve.args[0]
PopUpMessage(self, err_message)
self.emptyEntries()
return
def emptyEntries(self):
self.lineEdit.setText("")
self.lineEdit_2.setText("")
self.lineEdit_3.setText("")
if __name__ == "__main__":
application = QtWidgets.QApplication(sys.argv)
currWindow = UI()
currWindow.show()
sys.exit(application.exec_())