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

# Form implementation generated from reading ui file 'mashin_hesab.ui'
#
# Created by: PyQt5 UI code generator 5.15.0
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again.  Do not edit this file unless you know what you are doing.

from math import *
from PyQt5 import QtCore, QtGui, QtWidgets


class Ui_MainWindow(object):
    def setupUi(self, MainWindow):
        MainWindow.setObjectName("MainWindow")
        MainWindow.resize(526, 523)
        MainWindow.setStyleSheet("background-color: rgb(27, 27, 27);")
        self.centralwidget = QtWidgets.QWidget(MainWindow)
        self.centralwidget.setObjectName("centralwidget")
        self.vir = QtWidgets.QPushButton(self.centralwidget)
        self.vir.setGeometry(QtCore.QRect(370, 270, 51, 28))
        self.vir.setStyleSheet("background-color:  rgb(255, 0, 98);")
        self.vir.setObjectName(",")
        self.dlt = QtWidgets.QPushButton(self.centralwidget)
        self.dlt.setGeometry(QtCore.QRect(280, 380, 81, 28))
        self.dlt.setStyleSheet("background-color:  rgb(255, 255, 0);")
        self.dlt.setObjectName("del")
        self.clr = QtWidgets.QPushButton(self.centralwidget)
        self.clr.setGeometry(QtCore.QRect(430, 380, 81, 28))
        self.clr.setStyleSheet("background-color: rgb(132, 84, 26);")
        self.clr.setObjectName("clr")
        self.haft = QtWidgets.QPushButton(self.centralwidget)
        self.haft.setGeometry(QtCore.QRect(10, 90, 51, 28))
        self.haft.setStyleSheet("background-color: rgb(18, 206, 153);")
        self.haft.setObjectName("haft")
        self.hasht = QtWidgets.QPushButton(self.centralwidget)
        self.hasht.setGeometry(QtCore.QRect(100, 90, 51, 28))
        self.hasht.setStyleSheet("background-color: rgb(18, 206, 153);")
        self.hasht.setObjectName("hasht")
        self.noh = QtWidgets.QPushButton(self.centralwidget)
        self.noh.setGeometry(QtCore.QRect(190, 90, 51, 28))
        self.noh.setStyleSheet("background-color: rgb(18, 206, 153);")
        self.noh.setObjectName("noh")
        self.chahar = QtWidgets.QPushButton(self.centralwidget)
        self.chahar.setGeometry(QtCore.QRect(10, 170, 51, 28))
        self.chahar.setStyleSheet("background-color: rgb(18, 206, 153);")
        self.chahar.setObjectName("chahar")
        self.panj = QtWidgets.QPushButton(self.centralwidget)
        self.panj.setGeometry(QtCore.QRect(100, 170, 51, 28))
        self.panj.setStyleSheet("background-color: rgb(18, 206, 153);")
        self.panj.setObjectName("panj")
        self.shesh = QtWidgets.QPushButton(self.centralwidget)
        self.shesh.setGeometry(QtCore.QRect(190, 170, 51, 28))
        self.shesh.setStyleSheet("background-color: rgb(18, 206, 153);")
        self.shesh.setObjectName("shesh")
        self.yek = QtWidgets.QPushButton(self.centralwidget)
        self.yek.setGeometry(QtCore.QRect(10, 250, 51, 28))
        self.yek.setStyleSheet("background-color: rgb(18, 206, 153);")
        self.yek.setObjectName("yek")
        self.do_2 = QtWidgets.QPushButton(self.centralwidget)
        self.do_2.setGeometry(QtCore.QRect(100, 250, 51, 28))
        self.do_2.setStyleSheet("background-color: rgb(18, 206, 153);\n"
"")
        self.do_2.setObjectName("do_2")
        self.se = QtWidgets.QPushButton(self.centralwidget)
        self.se.setGeometry(QtCore.QRect(190, 250, 51, 28))
        self.se.setStyleSheet("background-color: rgb(18, 206, 153);")
        self.se.setObjectName("se")
        self.sefr = QtWidgets.QPushButton(self.centralwidget)
        self.sefr.setGeometry(QtCore.QRect(80, 300, 91, 28))
        self.sefr.setStyleSheet("background-color: rgb(18, 206, 153);")
        self.sefr.setObjectName("sefr")
        self.parantez_baz = QtWidgets.QPushButton(self.centralwidget)
        self.parantez_baz.setGeometry(QtCore.QRect(280, 90, 51, 28))
        self.parantez_baz.setStyleSheet("background-color: rgb(255, 170, 0);")
        self.parantez_baz.setObjectName("parantez_baz")
        self.parantez_baste = QtWidgets.QPushButton(self.centralwidget)
        self.parantez_baste.setGeometry(QtCore.QRect(370, 90, 51, 28))
        self.parantez_baste.setStyleSheet("background-color: rgb(255, 170, 0);")
        self.parantez_baste.setObjectName("parantez_baste")
        self.noqte = QtWidgets.QPushButton(self.centralwidget)
        self.noqte.setGeometry(QtCore.QRect(460, 90, 51, 28))
        self.noqte.setStyleSheet("background-color: rgb(174, 255, 0);")
        self.noqte.setObjectName("noqte")
        self.layoutWidget_2 = QtWidgets.QWidget(self.centralwidget)
        self.layoutWidget_2.setGeometry(QtCore.QRect(300, 300, 197, 69))
        self.layoutWidget_2.setObjectName("layoutWidget_2")
        self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.layoutWidget_2)
        self.verticalLayout_2.setContentsMargins(0, 0, 0, 0)
        self.verticalLayout_2.setObjectName("verticalLayout_2")
        self.horizontalLayout_4 = QtWidgets.QHBoxLayout()
        self.horizontalLayout_4.setObjectName("horizontalLayout_4")
        self.bealave = QtWidgets.QPushButton(self.layoutWidget_2)
        self.bealave.setStyleSheet("background-color: rgb(192, 12, 208);")
        self.bealave.setObjectName("bealave")
        self.horizontalLayout_4.addWidget(self.bealave)
        self.menha = QtWidgets.QPushButton(self.layoutWidget_2)
        self.menha.setStyleSheet("background-color: rgb(192, 12, 208);")
        self.menha.setObjectName("menha")
        self.horizontalLayout_4.addWidget(self.menha)
        self.verticalLayout_2.addLayout(self.horizontalLayout_4)
        self.horizontalLayout_5 = QtWidgets.QHBoxLayout()
        self.horizontalLayout_5.setObjectName("horizontalLayout_5")
        self.zarb = QtWidgets.QPushButton(self.layoutWidget_2)
        self.zarb.setStyleSheet("background-color: rgb(192, 12, 208);")
        self.zarb.setObjectName("zarb")
        self.horizontalLayout_5.addWidget(self.zarb)
        self.taqsim = QtWidgets.QPushButton(self.layoutWidget_2)
        self.taqsim.setStyleSheet("background-color: rgb(192, 12, 208);")
        self.taqsim.setObjectName("taqsim")
        self.horizontalLayout_5.addWidget(self.taqsim)
        self.verticalLayout_2.addLayout(self.horizontalLayout_5)
        self.tavan = QtWidgets.QPushButton(self.centralwidget)
        self.tavan.setGeometry(QtCore.QRect(370, 380, 51, 28))
        self.tavan.setStyleSheet("background-color: rgb(255, 74, 246);")
        self.tavan.setObjectName("tavan")
        self.mosavi = QtWidgets.QPushButton(self.centralwidget)
        self.mosavi.setGeometry(QtCore.QRect(280, 430, 231, 28))
        font = QtGui.QFont()
        font.setPointSize(13)
        self.mosavi.setFont(font)
        self.mosavi.setStyleSheet("background-color: rgb(255, 16, 48);")
        self.mosavi.setObjectName("mosavi")
        self.textBrowser = QtWidgets.QTextBrowser(self.centralwidget)
        self.textBrowser.setGeometry(QtCore.QRect(10, 330, 261, 141))
        self.textBrowser.setStyleSheet("background-color: rgb(181, 181, 181);")
        self.textBrowser.setObjectName("textBrowser")
        self.layoutWidget = QtWidgets.QWidget(self.centralwidget)
        self.layoutWidget.setGeometry(QtCore.QRect(300, 140, 197, 69))
        self.layoutWidget.setObjectName("layoutWidget")
        self.verticalLayout = QtWidgets.QVBoxLayout(self.layoutWidget)
        self.verticalLayout.setContentsMargins(0, 0, 0, 0)
        self.verticalLayout.setObjectName("verticalLayout")
        self.horizontalLayout = QtWidgets.QHBoxLayout()
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.sin = QtWidgets.QPushButton(self.layoutWidget)
        self.sin.setStyleSheet("background-color: rgb(40, 255, 16);")
        self.sin.setObjectName("sin")
        self.horizontalLayout.addWidget(self.sin)
        self.cos = QtWidgets.QPushButton(self.layoutWidget)
        self.cos.setStyleSheet("background-color: rgb(40, 255, 16);")
        self.cos.setObjectName("cos")
        self.horizontalLayout.addWidget(self.cos)
        self.verticalLayout.addLayout(self.horizontalLayout)
        self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
        self.horizontalLayout_2.setObjectName("horizontalLayout_2")
        self.tan = QtWidgets.QPushButton(self.layoutWidget)
        self.tan.setStyleSheet("background-color: rgb(40, 255, 16);")
        self.tan.setObjectName("tan")
        self.horizontalLayout_2.addWidget(self.tan)
        self.cot = QtWidgets.QPushButton(self.layoutWidget)
        self.cot.setStyleSheet("background-color: rgb(40, 255, 16);")
        self.cot.setObjectName("cot")
        self.horizontalLayout_2.addWidget(self.cot)
        self.verticalLayout.addLayout(self.horizontalLayout_2)
        self.layoutWidget1 = QtWidgets.QWidget(self.centralwidget)
        self.layoutWidget1.setGeometry(QtCore.QRect(300, 230, 195, 30))
        self.layoutWidget1.setObjectName("layoutWidget1")
        self.horizontalLayout_3 = QtWidgets.QHBoxLayout(self.layoutWidget1)
        self.horizontalLayout_3.setContentsMargins(0, 0, 0, 0)
        self.horizontalLayout_3.setObjectName("horizontalLayout_3")
        self.log = QtWidgets.QPushButton(self.layoutWidget1)
        self.log.setStyleSheet("background-color: rgb(1, 77, 255);")
        self.log.setObjectName("log")
        self.horizontalLayout_3.addWidget(self.log)
        self.Ln = QtWidgets.QPushButton(self.layoutWidget1)
        self.Ln.setStyleSheet("background-color: rgb(1, 77, 255);")
        self.Ln.setObjectName("Ln")
        self.horizontalLayout_3.addWidget(self.Ln)
        self.label = QtWidgets.QLabel(self.centralwidget)
        self.label.setGeometry(QtCore.QRect(0, 0, 531, 61))
        font = QtGui.QFont()
        font.setPointSize(19)
        self.label.setFont(font)
        self.label.setStyleSheet("background-color: rgb(231, 231, 231);")
        self.label.setText("")
        self.label.setObjectName("label")
        MainWindow.setCentralWidget(self.centralwidget)
        self.menubar = QtWidgets.QMenuBar(MainWindow)
        self.menubar.setGeometry(QtCore.QRect(0, 0, 526, 26))
        self.menubar.setObjectName("menubar")
        MainWindow.setMenuBar(self.menubar)
        self.statusbar = QtWidgets.QStatusBar(MainWindow)
        self.statusbar.setObjectName("statusbar")
        MainWindow.setStatusBar(self.statusbar)

        self.retranslateUi(MainWindow)
        self.sefr.clicked.connect(self.action_0)
        self.yek.clicked.connect(self.action_1)
        self.do_2.clicked.connect(self.action_2)
        self.se.clicked.connect(self.action_3)
        self.chahar.clicked.connect(self.action_4)
        self.panj.clicked.connect(self.action_5)
        self.shesh.clicked.connect(self.action_6)
        self.haft.clicked.connect(self.action_7)
        self.hasht.clicked.connect(self.action_8)
        self.noh.clicked.connect(self.action_9)
        self.parantez_baste.clicked.connect(self.action_pbaste)
        self.parantez_baz.clicked.connect(self.action_pbaz)
        self.noqte.clicked.connect(self.action_noqte)
        self.sin.clicked.connect(self.action_sin)
        self.cos.clicked.connect(self.action_cos)
        self.tan.clicked.connect(self.action_tan)
        self.cot.clicked.connect(self.action_cot)
        self.log.clicked.connect(self.action_log)
        self.Ln.clicked.connect(self.action_Ln)
        self.bealave.clicked.connect(self.action_bealave)
        self.menha.clicked.connect(self.action_menha)
        self.zarb.clicked.connect(self.action_zarb)
        self.taqsim.clicked.connect(self.action_taqsim)
        self.tavan.clicked.connect(self.action_tavan)
        self.vir.clicked.connect(self.action_vir)
        self.dlt.clicked.connect(self.action_del)
        self.clr.clicked.connect(self.action_clr)
        self.mosavi.clicked.connect(self.action_mosavi)
        QtCore.QMetaObject.connectSlotsByName(MainWindow)
#=================================================================================
# sakhte mashin hesab    
    def action_0(self):
        text = self.label.text()
        self.label.setText(text + '0')


    def action_1(self):
        text = self.label.text()
        self.label.setText(text + '1')


    def action_2(self):
        text = self.label.text()
        self.label.setText(text + '2')


    def action_3(self):
        text = self.label.text()
        self.label.setText(text + '3')


    def action_4(self):
        text = self.label.text()
        self.label.setText(text + '4')


    def action_5(self):
        text = self.label.text()
        self.label.setText(text + '5')


    def action_6(self):
        text = self.label.text()
        self.label.setText(text + '6')


    def action_7(self):
        text = self.label.text()
        self.label.setText(text + '7')


    def action_8(self):
        text = self.label.text()
        self.label.setText(text + '8')



    def action_9(self):
        text = self.label.text()
        self.label.setText(text + '9')


    def action_pbaz(self):
        text = self.label.text()
        self.label.setText(text + '(')


    def action_pbaste(self):
        text = self.label.text()
        self.label.setText(text + ')')


    def action_noqte(self):
        text = self.label.text()
        self.label.setText(text + '.')


    def action_sin(self):
        text = self.label.text()
        self.label.setText(text + 'sin')


    def action_cos(self):
        text = self.label.text()
        self.label.setText(text + 'cos')


    def action_tan(self):
        text = self.label.text()
        self.label.setText(text + 'tan')



    def action_cot(self):
        text = self.label.text()
        self.label.setText(text + 'cot')


    
    def action_log(self):
        text = self.label.text()
        self.label.setText(text + 'log10')



    def action_Ln(self):
        text = self.label.text()
        self.label.setText(text + 'log')



    def action_bealave(self):
        text = self.label.text()
        self.label.setText(text + '+')




    def action_menha(self):
        text = self.label.text()
        self.label.setText(text + '-')



    def action_zarb(self):
        text = self.label.text()
        self.label.setText(text + '*')



    def action_taqsim(self):
        text = self.label.text()
        self.label.setText(text + '/')




    def action_tavan(self):
        text = self.label.text()
        self.label.setText(text + 'pow')


    def action_vir(self):
        text = self.label.text()
        self.label.setText(text + ',')



    def action_del(self):
        text = self.label.text()
        self.label.setText(text[:len(text)-1])


    def action_clr(self):
        self.label.setText("")




    def action_mosavi(self):
        equal = self.label.text()

        try:
            ans = eval(equal)

            self.label.setText(str(ans))
        except:
            self.label.setText('wrong text!!!')

#=======================================================================================
    def retranslateUi(self, MainWindow):
        _translate = QtCore.QCoreApplication.translate
        MainWindow.setWindowTitle(_translate("MainWindow", "ماشین حساب"))
        self.haft.setText(_translate("MainWindow", "7"))
        self.vir.setText(_translate("MainWindow", ","))
        self.dlt.setText(_translate("MainWindow", "del"))
        self.clr.setText(_translate("MainWindow", "clear"))
        self.hasht.setText(_translate("MainWindow", "8"))
        self.noh.setText(_translate("MainWindow", "9"))
        self.chahar.setText(_translate("MainWindow", "4"))
        self.panj.setText(_translate("MainWindow", "5"))
        self.shesh.setText(_translate("MainWindow", "6"))
        self.yek.setText(_translate("MainWindow", "1"))
        self.do_2.setText(_translate("MainWindow", "2"))
        self.se.setText(_translate("MainWindow", "3"))
        self.sefr.setText(_translate("MainWindow", "0"))
        self.parantez_baz.setText(_translate("MainWindow", "("))
        self.parantez_baste.setText(_translate("MainWindow", ")"))
        self.noqte.setText(_translate("MainWindow", "."))
        self.bealave.setText(_translate("MainWindow", "+"))
        self.menha.setText(_translate("MainWindow", "-"))
        self.zarb.setText(_translate("MainWindow", "*"))
        self.taqsim.setText(_translate("MainWindow", "/"))
        self.tavan.setText(_translate("MainWindow", "^"))
        self.mosavi.setText(_translate("MainWindow", "="))
        self.textBrowser.setHtml(_translate("MainWindow", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
"<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n"
"p, li { white-space: pre-wrap; }\n"
"</style></head><body style=\" font-family:\'MS Shell Dlg 2\'; font-size:7.8pt; font-weight:400; font-style:normal;\">\n"
"<p align=\"center\" style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><br /></p>\n"
"<p align=\"center\" style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">CRATOR:<span style=\" font-weight:600; text-decoration: underline;\">moein tabasi</span></p>\n"
"<p align=\"center\" style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-weight:600; text-decoration: underline;\"><br /></p>\n"
"<p align=\"center\" style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">EMAIL:<span style=\" font-weight:600; font-style:italic; text-decoration: underline;\">moeintabasi1995@gmail.com</span></p>\n"
"<p align=\"center\" style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-weight:600; font-style:italic; text-decoration: underline;\"><br /></p>\n"
"<p align=\"center\" style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-weight:600; font-style:italic; text-decoration: underline;\"><br /></p>\n"
"<p align=\"center\" style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-size:12pt;\">tanx for using my app</span></p></body></html>"))
        self.sin.setText(_translate("MainWindow", "sin"))
        self.cos.setText(_translate("MainWindow", "cos"))
        self.tan.setText(_translate("MainWindow", "tan"))
        self.cot.setText(_translate("MainWindow", "cot"))
        self.log.setText(_translate("MainWindow", "log"))
        self.Ln.setText(_translate("MainWindow", "Ln"))


if __name__ == "__main__":
    import sys
    app = QtWidgets.QApplication(sys.argv)
    MainWindow = QtWidgets.QMainWindow()
    ui = Ui_MainWindow()
    ui.setupUi(MainWindow)
    MainWindow.show()
    sys.exit(app.exec_())