代码拉取完成,页面将自动刷新
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'd:\ProjectScript\PyqtDemo\caldemo\window.ui'
#
# Created by: PyQt5 UI code generator 5.6
#
# WARNING! All changes made in this file will be lost!
import os
import json
import sys
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtGui import *
from PyQt5.QtWidgets import QMainWindow,QApplication
from PyQt5.QtCore import *
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName("MainWindow")
MainWindow.resize(1002, 700)
MainWindow.setMinimumSize(QtCore.QSize(980, 700))
MainWindow.setMaximumSize(QtCore.QSize(1002, 700))
self.centralwidget = QtWidgets.QWidget(MainWindow)
self.centralwidget.setObjectName("centralwidget")
self.tabWidget = QtWidgets.QTabWidget(self.centralwidget)
self.tabWidget.setGeometry(QtCore.QRect(10, 0, 980, 700))
self.tabWidget.setMinimumSize(QtCore.QSize(980, 700))
self.tabWidget.setMaximumSize(QtCore.QSize(980, 700))
font = QtGui.QFont()
font.setFamily("楷体")
font.setPointSize(14)
font.setBold(True)
font.setItalic(False)
font.setWeight(75)
self.tabWidget.setFont(font)
self.tabWidget.setStyleSheet("QTabBar::tab{width:320;height:50;}")
self.tabWidget.setObjectName("tabWidget")
self.tab_dangjia = QtWidgets.QWidget()
self.tab_dangjia.setObjectName("tab_dangjia")
self.gridLayout = QtWidgets.QGridLayout(self.tab_dangjia)
self.gridLayout.setContentsMargins(0, 0, 0, 0)
self.gridLayout.setObjectName("gridLayout")
self.label_0 = QtWidgets.QLabel(self.tab_dangjia)
self.label_0.setMinimumSize(QtCore.QSize(0, 35))
self.label_0.setMaximumSize(QtCore.QSize(16777215, 35))
font = QtGui.QFont()
font.setFamily("黑体")
font.setPointSize(14)
self.label_0.setFont(font)
self.label_0.setStyleSheet("background-color: rgb(85, 255, 255);")
self.label_0.setObjectName("label_0")
self.gridLayout.addWidget(self.label_0, 0, 0, 1, 1)
self.line0 = QtWidgets.QLineEdit(self.tab_dangjia)
self.line0.setMinimumSize(QtCore.QSize(0, 35))
self.line0.setMaximumSize(QtCore.QSize(16777215, 35))
self.line0.setText("")
self.line0.setObjectName("line0")
self.gridLayout.addWidget(self.line0, 0, 1, 1, 1)
self.label_3 = QtWidgets.QLabel(self.tab_dangjia)
self.label_3.setMinimumSize(QtCore.QSize(0, 35))
self.label_3.setMaximumSize(QtCore.QSize(16777215, 35))
font = QtGui.QFont()
font.setFamily("黑体")
font.setPointSize(14)
self.label_3.setFont(font)
self.label_3.setStyleSheet("background-color: rgb(85, 255, 255);")
self.label_3.setObjectName("label_3")
self.gridLayout.addWidget(self.label_3, 0, 2, 1, 1)
self.line1 = QtWidgets.QLineEdit(self.tab_dangjia)
self.line1.setMinimumSize(QtCore.QSize(0, 35))
self.line1.setMaximumSize(QtCore.QSize(16777215, 35))
self.line1.setText("")
self.line1.setObjectName("line1")
self.gridLayout.addWidget(self.line1, 0, 4, 1, 1)
self.label_11 = QtWidgets.QLabel(self.tab_dangjia)
self.label_11.setMinimumSize(QtCore.QSize(0, 35))
self.label_11.setMaximumSize(QtCore.QSize(16777215, 35))
font = QtGui.QFont()
font.setFamily("黑体")
font.setPointSize(14)
self.label_11.setFont(font)
self.label_11.setStyleSheet("background-color: rgb(85, 255, 255);")
self.label_11.setObjectName("label_11")
self.gridLayout.addWidget(self.label_11, 1, 0, 1, 1)
self.line2 = QtWidgets.QLineEdit(self.tab_dangjia)
self.line2.setMinimumSize(QtCore.QSize(0, 35))
self.line2.setMaximumSize(QtCore.QSize(16777215, 35))
self.line2.setText("")
self.line2.setObjectName("line2")
self.gridLayout.addWidget(self.line2, 1, 1, 1, 1)
self.label_2 = QtWidgets.QLabel(self.tab_dangjia)
self.label_2.setMinimumSize(QtCore.QSize(0, 35))
self.label_2.setMaximumSize(QtCore.QSize(16777215, 35))
font = QtGui.QFont()
font.setFamily("黑体")
font.setPointSize(14)
self.label_2.setFont(font)
self.label_2.setStyleSheet("background-color: rgb(85, 255, 255);")
self.label_2.setObjectName("label_2")
self.gridLayout.addWidget(self.label_2, 1, 2, 1, 1)
self.line3 = QtWidgets.QLineEdit(self.tab_dangjia)
self.line3.setMinimumSize(QtCore.QSize(0, 35))
self.line3.setMaximumSize(QtCore.QSize(16777215, 35))
self.line3.setText("")
self.line3.setObjectName("line3")
self.gridLayout.addWidget(self.line3, 1, 4, 1, 1)
self.label_5 = QtWidgets.QLabel(self.tab_dangjia)
self.label_5.setMinimumSize(QtCore.QSize(0, 35))
self.label_5.setMaximumSize(QtCore.QSize(16777215, 35))
font = QtGui.QFont()
font.setFamily("黑体")
font.setPointSize(14)
self.label_5.setFont(font)
self.label_5.setStyleSheet("background-color: rgb(85, 255, 255);")
self.label_5.setObjectName("label_5")
self.gridLayout.addWidget(self.label_5, 2, 0, 1, 1)
self.line4 = QtWidgets.QLineEdit(self.tab_dangjia)
self.line4.setMinimumSize(QtCore.QSize(0, 35))
self.line4.setMaximumSize(QtCore.QSize(16777215, 35))
self.line4.setText("")
self.line4.setObjectName("line4")
self.gridLayout.addWidget(self.line4, 2, 1, 1, 1)
self.label_6 = QtWidgets.QLabel(self.tab_dangjia)
self.label_6.setMinimumSize(QtCore.QSize(0, 35))
self.label_6.setMaximumSize(QtCore.QSize(16777215, 35))
font = QtGui.QFont()
font.setFamily("黑体")
font.setPointSize(14)
self.label_6.setFont(font)
self.label_6.setStyleSheet("background-color: rgb(85, 255, 255);")
self.label_6.setObjectName("label_6")
self.gridLayout.addWidget(self.label_6, 2, 2, 1, 1)
self.line5 = QtWidgets.QLineEdit(self.tab_dangjia)
self.line5.setMinimumSize(QtCore.QSize(0, 35))
self.line5.setMaximumSize(QtCore.QSize(16777215, 35))
self.line5.setText("")
self.line5.setObjectName("line5")
self.gridLayout.addWidget(self.line5, 2, 4, 1, 1)
self.label_4 = QtWidgets.QLabel(self.tab_dangjia)
self.label_4.setMinimumSize(QtCore.QSize(0, 35))
self.label_4.setMaximumSize(QtCore.QSize(16777215, 35))
font = QtGui.QFont()
font.setFamily("黑体")
font.setPointSize(14)
self.label_4.setFont(font)
self.label_4.setStyleSheet("background-color: rgb(85, 255, 255);")
self.label_4.setObjectName("label_4")
self.gridLayout.addWidget(self.label_4, 3, 0, 1, 1)
self.line6 = QtWidgets.QLineEdit(self.tab_dangjia)
self.line6.setMinimumSize(QtCore.QSize(0, 35))
self.line6.setMaximumSize(QtCore.QSize(16777215, 35))
self.line6.setText("")
self.line6.setObjectName("line6")
self.gridLayout.addWidget(self.line6, 3, 1, 1, 1)
self.label_10 = QtWidgets.QLabel(self.tab_dangjia)
self.label_10.setMinimumSize(QtCore.QSize(0, 35))
self.label_10.setMaximumSize(QtCore.QSize(16777215, 35))
font = QtGui.QFont()
font.setFamily("黑体")
font.setPointSize(14)
self.label_10.setFont(font)
self.label_10.setStyleSheet("background-color: rgb(85, 255, 255);")
self.label_10.setObjectName("label_10")
self.gridLayout.addWidget(self.label_10, 3, 2, 1, 1)
self.line7 = QtWidgets.QLineEdit(self.tab_dangjia)
self.line7.setMinimumSize(QtCore.QSize(0, 35))
self.line7.setMaximumSize(QtCore.QSize(16777215, 35))
self.line7.setText("")
self.line7.setObjectName("line7")
self.gridLayout.addWidget(self.line7, 3, 4, 1, 1)
self.label_9 = QtWidgets.QLabel(self.tab_dangjia)
self.label_9.setMinimumSize(QtCore.QSize(0, 35))
self.label_9.setMaximumSize(QtCore.QSize(16777215, 35))
font = QtGui.QFont()
font.setFamily("黑体")
font.setPointSize(14)
self.label_9.setFont(font)
self.label_9.setStyleSheet("background-color: rgb(85, 255, 255);")
self.label_9.setObjectName("label_9")
self.gridLayout.addWidget(self.label_9, 4, 0, 1, 1)
self.line8 = QtWidgets.QLineEdit(self.tab_dangjia)
self.line8.setMinimumSize(QtCore.QSize(0, 35))
self.line8.setMaximumSize(QtCore.QSize(16777215, 35))
self.line8.setText("")
self.line8.setObjectName("line8")
self.gridLayout.addWidget(self.line8, 4, 1, 1, 1)
self.label_8 = QtWidgets.QLabel(self.tab_dangjia)
self.label_8.setMinimumSize(QtCore.QSize(0, 35))
self.label_8.setMaximumSize(QtCore.QSize(16777215, 35))
font = QtGui.QFont()
font.setFamily("黑体")
font.setPointSize(14)
self.label_8.setFont(font)
self.label_8.setStyleSheet("background-color: rgb(85, 255, 255);")
self.label_8.setObjectName("label_8")
self.gridLayout.addWidget(self.label_8, 4, 2, 1, 1)
self.line9 = QtWidgets.QLineEdit(self.tab_dangjia)
self.line9.setMinimumSize(QtCore.QSize(0, 35))
self.line9.setMaximumSize(QtCore.QSize(16777215, 35))
self.line9.setText("")
self.line9.setObjectName("line9")
self.gridLayout.addWidget(self.line9, 4, 4, 1, 1)
self.label_12 = QtWidgets.QLabel(self.tab_dangjia)
self.label_12.setMinimumSize(QtCore.QSize(0, 35))
self.label_12.setMaximumSize(QtCore.QSize(16777215, 35))
font = QtGui.QFont()
font.setFamily("黑体")
font.setPointSize(14)
self.label_12.setFont(font)
self.label_12.setStyleSheet("background-color: rgb(85, 255, 255);")
self.label_12.setObjectName("label_12")
self.gridLayout.addWidget(self.label_12, 5, 0, 1, 1)
self.line10 = QtWidgets.QLineEdit(self.tab_dangjia)
self.line10.setMinimumSize(QtCore.QSize(0, 35))
self.line10.setMaximumSize(QtCore.QSize(16777215, 35))
self.line10.setText("")
self.line10.setObjectName("line10")
self.gridLayout.addWidget(self.line10, 5, 1, 1, 1)
self.label_13 = QtWidgets.QLabel(self.tab_dangjia)
self.label_13.setMinimumSize(QtCore.QSize(0, 35))
self.label_13.setMaximumSize(QtCore.QSize(16777215, 35))
font = QtGui.QFont()
font.setFamily("黑体")
font.setPointSize(14)
self.label_13.setFont(font)
self.label_13.setStyleSheet("background-color: rgb(85, 255, 255);")
self.label_13.setObjectName("label_13")
self.gridLayout.addWidget(self.label_13, 5, 2, 1, 2)
self.line11 = QtWidgets.QLineEdit(self.tab_dangjia)
self.line11.setMinimumSize(QtCore.QSize(0, 35))
self.line11.setMaximumSize(QtCore.QSize(16777215, 35))
self.line11.setText("")
self.line11.setObjectName("line11")
self.gridLayout.addWidget(self.line11, 5, 4, 1, 1)
self.label_14 = QtWidgets.QLabel(self.tab_dangjia)
self.label_14.setMinimumSize(QtCore.QSize(0, 35))
self.label_14.setMaximumSize(QtCore.QSize(16777215, 35))
font = QtGui.QFont()
font.setFamily("黑体")
font.setPointSize(14)
self.label_14.setFont(font)
self.label_14.setStyleSheet("background-color: rgb(85, 255, 255);")
self.label_14.setObjectName("label_14")
self.gridLayout.addWidget(self.label_14, 6, 0, 1, 1)
self.line12 = QtWidgets.QLineEdit(self.tab_dangjia)
self.line12.setMinimumSize(QtCore.QSize(0, 35))
self.line12.setMaximumSize(QtCore.QSize(16777215, 35))
self.line12.setText("")
self.line12.setObjectName("line12")
self.gridLayout.addWidget(self.line12, 6, 1, 1, 1)
self.label_15 = QtWidgets.QLabel(self.tab_dangjia)
self.label_15.setMinimumSize(QtCore.QSize(0, 35))
self.label_15.setMaximumSize(QtCore.QSize(16777215, 35))
font = QtGui.QFont()
font.setFamily("黑体")
font.setPointSize(14)
self.label_15.setFont(font)
self.label_15.setStyleSheet("background-color: rgb(85, 255, 255);")
self.label_15.setObjectName("label_15")
self.gridLayout.addWidget(self.label_15, 6, 2, 1, 2)
self.line13 = QtWidgets.QLineEdit(self.tab_dangjia)
self.line13.setMinimumSize(QtCore.QSize(0, 35))
self.line13.setMaximumSize(QtCore.QSize(16777215, 35))
self.line13.setText("")
self.line13.setObjectName("line13")
self.gridLayout.addWidget(self.line13, 6, 4, 1, 1)
self.label_30 = QtWidgets.QLabel(self.tab_dangjia)
self.label_30.setMinimumSize(QtCore.QSize(0, 35))
self.label_30.setMaximumSize(QtCore.QSize(16777215, 35))
font = QtGui.QFont()
font.setFamily("黑体")
font.setPointSize(14)
self.label_30.setFont(font)
self.label_30.setStyleSheet("background-color: rgb(85, 255, 255);")
self.label_30.setObjectName("label_30")
self.gridLayout.addWidget(self.label_30, 7, 0, 1, 1)
self.line14 = QtWidgets.QLineEdit(self.tab_dangjia)
self.line14.setMinimumSize(QtCore.QSize(0, 35))
self.line14.setMaximumSize(QtCore.QSize(16777215, 35))
self.line14.setText("")
self.line14.setObjectName("line14")
self.gridLayout.addWidget(self.line14, 7, 1, 1, 1)
self.label_29 = QtWidgets.QLabel(self.tab_dangjia)
self.label_29.setMinimumSize(QtCore.QSize(0, 35))
self.label_29.setMaximumSize(QtCore.QSize(16777215, 35))
font = QtGui.QFont()
font.setFamily("黑体")
font.setPointSize(14)
self.label_29.setFont(font)
self.label_29.setStyleSheet("background-color: rgb(85, 255, 255);")
self.label_29.setObjectName("label_29")
self.gridLayout.addWidget(self.label_29, 7, 2, 1, 2)
self.line15 = QtWidgets.QLineEdit(self.tab_dangjia)
self.line15.setMinimumSize(QtCore.QSize(0, 35))
self.line15.setMaximumSize(QtCore.QSize(16777215, 35))
self.line15.setText("")
self.line15.setObjectName("line15")
self.gridLayout.addWidget(self.line15, 7, 4, 1, 1)
self.clear = QtWidgets.QPushButton(self.tab_dangjia)
self.clear.setMinimumSize(QtCore.QSize(60, 50))
self.clear.setStyleSheet("QPushButton{background:rgb(170, 255, 127);border-radius:10px;}QPushButton:hover{background:rgb(170, 170, 127);}QPushButton:pressed{background:rgb(170, 170, 255);}")
self.clear.setObjectName("clear")
self.gridLayout.addWidget(self.clear, 8, 1, 1, 1)
self.pushButton_2 = QtWidgets.QPushButton(self.tab_dangjia)
self.pushButton_2.setMinimumSize(QtCore.QSize(60, 50))
self.pushButton_2.setStyleSheet("QPushButton{background:rgb(170, 255, 127);border-radius:10px;}QPushButton:hover{background:rgb(170, 170, 127);}QPushButton:pressed{background:rgb(170, 170, 255);}")
self.pushButton_2.setObjectName("pushButton_2")
self.gridLayout.addWidget(self.pushButton_2, 8, 3, 1, 2)
self.widget_2 = QtWidgets.QWidget(self.tab_dangjia)
self.widget_2.setMaximumSize(QtCore.QSize(16777215, 150))
self.widget_2.setObjectName("widget_2")
self.gridLayout.addWidget(self.widget_2, 9, 0, 1, 5)
self.tabWidget.addTab(self.tab_dangjia, "")
self.tab_calculator = QtWidgets.QWidget()
self.tab_calculator.setObjectName("tab_calculator")
self.gridLayout_2 = QtWidgets.QGridLayout(self.tab_calculator)
self.gridLayout_2.setContentsMargins(0, 0, 0, 0)
self.gridLayout_2.setObjectName("gridLayout_2")
self.label_46 = QtWidgets.QLabel(self.tab_calculator)
self.label_46.setMinimumSize(QtCore.QSize(0, 33))
self.label_46.setMaximumSize(QtCore.QSize(16777215, 33))
font = QtGui.QFont()
font.setFamily("黑体")
font.setPointSize(14)
self.label_46.setFont(font)
self.label_46.setStyleSheet("background-color: rgb(85, 255, 255);")
self.label_46.setObjectName("label_46")
self.gridLayout_2.addWidget(self.label_46, 0, 0, 1, 1)
self.line0_4 = QtWidgets.QLineEdit(self.tab_calculator)
self.line0_4.setMinimumSize(QtCore.QSize(0, 33))
self.line0_4.setMaximumSize(QtCore.QSize(16777215, 33))
self.line0_4.setText("")
self.line0_4.setObjectName("line0_4")
self.gridLayout_2.addWidget(self.line0_4, 0, 1, 1, 1)
self.label_42 = QtWidgets.QLabel(self.tab_calculator)
self.label_42.setMinimumSize(QtCore.QSize(0, 33))
self.label_42.setMaximumSize(QtCore.QSize(16777215, 33))
font = QtGui.QFont()
font.setFamily("黑体")
font.setPointSize(14)
self.label_42.setFont(font)
self.label_42.setStyleSheet("background-color: rgb(85, 255, 255);")
self.label_42.setObjectName("label_42")
self.gridLayout_2.addWidget(self.label_42, 0, 2, 1, 1)
self.line1_4 = QtWidgets.QLineEdit(self.tab_calculator)
self.line1_4.setMinimumSize(QtCore.QSize(0, 33))
self.line1_4.setMaximumSize(QtCore.QSize(16777215, 33))
self.line1_4.setText("")
self.line1_4.setObjectName("line1_4")
self.gridLayout_2.addWidget(self.line1_4, 0, 3, 1, 1)
self.label_37 = QtWidgets.QLabel(self.tab_calculator)
self.label_37.setMinimumSize(QtCore.QSize(0, 33))
self.label_37.setMaximumSize(QtCore.QSize(16777215, 33))
font = QtGui.QFont()
font.setFamily("黑体")
font.setPointSize(14)
self.label_37.setFont(font)
self.label_37.setStyleSheet("background-color: rgb(85, 255, 255);")
self.label_37.setObjectName("label_37")
self.gridLayout_2.addWidget(self.label_37, 1, 0, 1, 1)
self.line2_4 = QtWidgets.QLineEdit(self.tab_calculator)
self.line2_4.setMinimumSize(QtCore.QSize(0, 33))
self.line2_4.setMaximumSize(QtCore.QSize(16777215, 33))
self.line2_4.setText("")
self.line2_4.setObjectName("line2_4")
self.gridLayout_2.addWidget(self.line2_4, 1, 1, 1, 1)
self.label_38 = QtWidgets.QLabel(self.tab_calculator)
self.label_38.setMinimumSize(QtCore.QSize(0, 33))
self.label_38.setMaximumSize(QtCore.QSize(16777215, 33))
font = QtGui.QFont()
font.setFamily("黑体")
font.setPointSize(14)
self.label_38.setFont(font)
self.label_38.setStyleSheet("background-color: rgb(85, 255, 255);")
self.label_38.setObjectName("label_38")
self.gridLayout_2.addWidget(self.label_38, 1, 2, 1, 1)
self.line3_4 = QtWidgets.QLineEdit(self.tab_calculator)
self.line3_4.setMinimumSize(QtCore.QSize(0, 33))
self.line3_4.setMaximumSize(QtCore.QSize(16777215, 33))
self.line3_4.setText("")
self.line3_4.setObjectName("line3_4")
self.gridLayout_2.addWidget(self.line3_4, 1, 3, 1, 1)
self.label_36 = QtWidgets.QLabel(self.tab_calculator)
self.label_36.setMinimumSize(QtCore.QSize(0, 33))
self.label_36.setMaximumSize(QtCore.QSize(16777215, 33))
font = QtGui.QFont()
font.setFamily("黑体")
font.setPointSize(14)
self.label_36.setFont(font)
self.label_36.setStyleSheet("background-color: rgb(85, 255, 255);")
self.label_36.setObjectName("label_36")
self.gridLayout_2.addWidget(self.label_36, 2, 0, 1, 1)
self.line4_4 = QtWidgets.QLineEdit(self.tab_calculator)
self.line4_4.setMinimumSize(QtCore.QSize(0, 33))
self.line4_4.setMaximumSize(QtCore.QSize(16777215, 33))
self.line4_4.setText("")
self.line4_4.setObjectName("line4_4")
self.gridLayout_2.addWidget(self.line4_4, 2, 1, 1, 1)
self.label_44 = QtWidgets.QLabel(self.tab_calculator)
self.label_44.setMinimumSize(QtCore.QSize(0, 33))
self.label_44.setMaximumSize(QtCore.QSize(16777215, 33))
font = QtGui.QFont()
font.setFamily("黑体")
font.setPointSize(14)
self.label_44.setFont(font)
self.label_44.setStyleSheet("background-color: rgb(85, 255, 255);")
self.label_44.setObjectName("label_44")
self.gridLayout_2.addWidget(self.label_44, 2, 2, 1, 1)
self.line5_4 = QtWidgets.QLineEdit(self.tab_calculator)
self.line5_4.setMinimumSize(QtCore.QSize(0, 33))
self.line5_4.setMaximumSize(QtCore.QSize(16777215, 33))
self.line5_4.setText("")
self.line5_4.setObjectName("line5_4")
self.gridLayout_2.addWidget(self.line5_4, 2, 3, 1, 1)
self.label_40 = QtWidgets.QLabel(self.tab_calculator)
self.label_40.setMinimumSize(QtCore.QSize(0, 33))
self.label_40.setMaximumSize(QtCore.QSize(16777215, 33))
font = QtGui.QFont()
font.setFamily("黑体")
font.setPointSize(14)
self.label_40.setFont(font)
self.label_40.setStyleSheet("background-color: rgb(85, 255, 255);")
self.label_40.setObjectName("label_40")
self.gridLayout_2.addWidget(self.label_40, 3, 0, 1, 1)
self.line6_4 = QtWidgets.QLineEdit(self.tab_calculator)
self.line6_4.setMinimumSize(QtCore.QSize(0, 33))
self.line6_4.setMaximumSize(QtCore.QSize(16777215, 33))
self.line6_4.setText("")
self.line6_4.setObjectName("line6_4")
self.gridLayout_2.addWidget(self.line6_4, 3, 1, 1, 1)
self.label_47 = QtWidgets.QLabel(self.tab_calculator)
self.label_47.setMinimumSize(QtCore.QSize(0, 33))
self.label_47.setMaximumSize(QtCore.QSize(16777215, 33))
font = QtGui.QFont()
font.setFamily("黑体")
font.setPointSize(14)
self.label_47.setFont(font)
self.label_47.setStyleSheet("background-color: rgb(85, 255, 255);")
self.label_47.setObjectName("label_47")
self.gridLayout_2.addWidget(self.label_47, 3, 2, 1, 1)
self.line7_4 = QtWidgets.QLineEdit(self.tab_calculator)
self.line7_4.setMinimumSize(QtCore.QSize(0, 33))
self.line7_4.setMaximumSize(QtCore.QSize(16777215, 33))
self.line7_4.setText("")
self.line7_4.setObjectName("line7_4")
self.gridLayout_2.addWidget(self.line7_4, 3, 3, 1, 1)
self.label_43 = QtWidgets.QLabel(self.tab_calculator)
self.label_43.setMinimumSize(QtCore.QSize(0, 33))
self.label_43.setMaximumSize(QtCore.QSize(16777215, 33))
font = QtGui.QFont()
font.setFamily("黑体")
font.setPointSize(14)
self.label_43.setFont(font)
self.label_43.setStyleSheet("background-color: rgb(85, 255, 255);")
self.label_43.setObjectName("label_43")
self.gridLayout_2.addWidget(self.label_43, 4, 0, 1, 1)
self.line8_4 = QtWidgets.QLineEdit(self.tab_calculator)
self.line8_4.setMinimumSize(QtCore.QSize(0, 33))
self.line8_4.setMaximumSize(QtCore.QSize(16777215, 33))
self.line8_4.setText("")
self.line8_4.setObjectName("line8_4")
self.gridLayout_2.addWidget(self.line8_4, 4, 1, 1, 1)
self.label_41 = QtWidgets.QLabel(self.tab_calculator)
self.label_41.setMinimumSize(QtCore.QSize(0, 33))
self.label_41.setMaximumSize(QtCore.QSize(16777215, 33))
font = QtGui.QFont()
font.setFamily("黑体")
font.setPointSize(14)
self.label_41.setFont(font)
self.label_41.setStyleSheet("background-color: rgb(85, 255, 255);")
self.label_41.setObjectName("label_41")
self.gridLayout_2.addWidget(self.label_41, 4, 2, 1, 1)
self.line9_4 = QtWidgets.QLineEdit(self.tab_calculator)
self.line9_4.setMinimumSize(QtCore.QSize(0, 33))
self.line9_4.setMaximumSize(QtCore.QSize(16777215, 33))
self.line9_4.setText("")
self.line9_4.setObjectName("line9_4")
self.gridLayout_2.addWidget(self.line9_4, 4, 3, 1, 1)
self.label_45 = QtWidgets.QLabel(self.tab_calculator)
self.label_45.setMinimumSize(QtCore.QSize(0, 33))
self.label_45.setMaximumSize(QtCore.QSize(16777215, 33))
font = QtGui.QFont()
font.setFamily("黑体")
font.setPointSize(14)
self.label_45.setFont(font)
self.label_45.setStyleSheet("background-color: rgb(85, 255, 255);")
self.label_45.setObjectName("label_45")
self.gridLayout_2.addWidget(self.label_45, 5, 0, 1, 1)
self.line10_4 = QtWidgets.QLineEdit(self.tab_calculator)
self.line10_4.setMinimumSize(QtCore.QSize(0, 33))
self.line10_4.setMaximumSize(QtCore.QSize(16777215, 33))
self.line10_4.setText("")
self.line10_4.setObjectName("line10_4")
self.gridLayout_2.addWidget(self.line10_4, 5, 1, 1, 1)
self.label_39 = QtWidgets.QLabel(self.tab_calculator)
self.label_39.setMinimumSize(QtCore.QSize(0, 33))
self.label_39.setMaximumSize(QtCore.QSize(16777215, 33))
font = QtGui.QFont()
font.setFamily("黑体")
font.setPointSize(14)
self.label_39.setFont(font)
self.label_39.setStyleSheet("background-color: rgb(85, 255, 255);")
self.label_39.setObjectName("label_39")
self.gridLayout_2.addWidget(self.label_39, 5, 2, 1, 1)
self.line11_4 = QtWidgets.QLineEdit(self.tab_calculator)
self.line11_4.setMinimumSize(QtCore.QSize(0, 33))
self.line11_4.setMaximumSize(QtCore.QSize(16777215, 33))
self.line11_4.setText("")
self.line11_4.setObjectName("line11_4")
self.gridLayout_2.addWidget(self.line11_4, 5, 3, 1, 1)
self.label_70 = QtWidgets.QLabel(self.tab_calculator)
self.label_70.setMinimumSize(QtCore.QSize(0, 33))
self.label_70.setMaximumSize(QtCore.QSize(16777215, 33))
font = QtGui.QFont()
font.setFamily("黑体")
font.setPointSize(14)
self.label_70.setFont(font)
self.label_70.setStyleSheet("background-color: rgb(85, 255, 255);")
self.label_70.setObjectName("label_70")
self.gridLayout_2.addWidget(self.label_70, 6, 0, 1, 1)
self.line12_4 = QtWidgets.QLineEdit(self.tab_calculator)
self.line12_4.setMinimumSize(QtCore.QSize(0, 33))
self.line12_4.setMaximumSize(QtCore.QSize(16777215, 33))
self.line12_4.setText("")
self.line12_4.setObjectName("line12_4")
self.gridLayout_2.addWidget(self.line12_4, 6, 1, 1, 1)
self.label_71 = QtWidgets.QLabel(self.tab_calculator)
self.label_71.setMinimumSize(QtCore.QSize(0, 33))
self.label_71.setMaximumSize(QtCore.QSize(16777215, 33))
font = QtGui.QFont()
font.setFamily("黑体")
font.setPointSize(14)
self.label_71.setFont(font)
self.label_71.setStyleSheet("background-color: rgb(85, 255, 255);")
self.label_71.setObjectName("label_71")
self.gridLayout_2.addWidget(self.label_71, 6, 2, 1, 1)
self.line13_4 = QtWidgets.QLineEdit(self.tab_calculator)
self.line13_4.setMinimumSize(QtCore.QSize(0, 33))
self.line13_4.setMaximumSize(QtCore.QSize(16777215, 33))
self.line13_4.setText("")
self.line13_4.setObjectName("line13_4")
self.gridLayout_2.addWidget(self.line13_4, 6, 3, 1, 1)
self.label_69 = QtWidgets.QLabel(self.tab_calculator)
self.label_69.setMinimumSize(QtCore.QSize(0, 33))
self.label_69.setMaximumSize(QtCore.QSize(16777215, 33))
font = QtGui.QFont()
font.setFamily("黑体")
font.setPointSize(14)
self.label_69.setFont(font)
self.label_69.setStyleSheet("background-color: rgb(85, 255, 255);")
self.label_69.setObjectName("label_69")
self.gridLayout_2.addWidget(self.label_69, 7, 0, 1, 1)
self.line14_4 = QtWidgets.QLineEdit(self.tab_calculator)
self.line14_4.setMinimumSize(QtCore.QSize(0, 33))
self.line14_4.setMaximumSize(QtCore.QSize(16777215, 33))
self.line14_4.setText("")
self.line14_4.setObjectName("line14_4")
self.gridLayout_2.addWidget(self.line14_4, 7, 1, 1, 1)
self.label_68 = QtWidgets.QLabel(self.tab_calculator)
self.label_68.setMinimumSize(QtCore.QSize(0, 33))
self.label_68.setMaximumSize(QtCore.QSize(16777215, 33))
font = QtGui.QFont()
font.setFamily("黑体")
font.setPointSize(14)
self.label_68.setFont(font)
self.label_68.setStyleSheet("background-color: rgb(85, 255, 255);")
self.label_68.setObjectName("label_68")
self.gridLayout_2.addWidget(self.label_68, 7, 2, 1, 1)
self.line15_4 = QtWidgets.QLineEdit(self.tab_calculator)
self.line15_4.setMinimumSize(QtCore.QSize(0, 33))
self.line15_4.setMaximumSize(QtCore.QSize(16777215, 33))
self.line15_4.setText("")
self.line15_4.setObjectName("line15_4")
self.gridLayout_2.addWidget(self.line15_4, 7, 3, 1, 1)
self.clear_4 = QtWidgets.QPushButton(self.tab_calculator)
self.clear_4.setMinimumSize(QtCore.QSize(60, 50))
self.clear_4.setStyleSheet("QPushButton{background:rgb(170, 255, 127);border-radius:10px;}QPushButton:hover{background:rgb(170, 170, 127);}QPushButton:pressed{background:rgb(170, 170, 255);}")
self.clear_4.setObjectName("clear_4")
self.gridLayout_2.addWidget(self.clear_4, 8, 1, 1, 1)
self.pushButton_5 = QtWidgets.QPushButton(self.tab_calculator)
self.pushButton_5.setMinimumSize(QtCore.QSize(60, 50))
self.pushButton_5.setStyleSheet("QPushButton{background:rgb(170, 255, 127);border-radius:10px;}QPushButton:hover{background:rgb(170, 170, 127);}QPushButton:pressed{background:rgb(170, 170, 255);}")
self.pushButton_5.setObjectName("pushButton_5")
self.gridLayout_2.addWidget(self.pushButton_5, 8, 3, 1, 1)
self.widget = QtWidgets.QWidget(self.tab_calculator)
self.widget.setMinimumSize(QtCore.QSize(0, 150))
self.widget.setMaximumSize(QtCore.QSize(16777215, 150))
self.widget.setStyleSheet("")
self.widget.setObjectName("widget")
self.label_49 = QtWidgets.QLabel(self.widget)
self.label_49.setGeometry(QtCore.QRect(11, 18, 130, 50))
self.label_49.setMinimumSize(QtCore.QSize(130, 50))
font = QtGui.QFont()
font.setFamily("隶书")
font.setPointSize(18)
self.label_49.setFont(font)
self.label_49.setStyleSheet("background:rgb(85, 170, 127);border-radius:15px;")
self.label_49.setObjectName("label_49")
self.price = QtWidgets.QLineEdit(self.widget)
self.price.setGeometry(QtCore.QRect(148, 18, 307, 50))
self.price.setMinimumSize(QtCore.QSize(0, 50))
self.price.setMaximumSize(QtCore.QSize(16777215, 150))
font = QtGui.QFont()
font.setFamily("Algerian")
font.setPointSize(14)
self.price.setFont(font)
self.price.setText("")
self.price.setObjectName("price")
self.label = QtWidgets.QLabel(self.widget)
self.label.setGeometry(QtCore.QRect(462, 18, 130, 50))
self.label.setMinimumSize(QtCore.QSize(130, 50))
font = QtGui.QFont()
font.setFamily("隶书")
font.setPointSize(18)
self.label.setFont(font)
self.label.setStyleSheet("background:rgb(85, 170, 127);border-radius:15px;")
self.label.setObjectName("label")
self.receviable = QtWidgets.QLineEdit(self.widget)
self.receviable.setGeometry(QtCore.QRect(599, 18, 307, 50))
self.receviable.setMinimumSize(QtCore.QSize(0, 50))
font = QtGui.QFont()
font.setFamily("Algerian")
font.setPointSize(14)
self.receviable.setFont(font)
self.receviable.setObjectName("receviable")
self.label_48 = QtWidgets.QLabel(self.widget)
self.label_48.setGeometry(QtCore.QRect(11, 82, 130, 50))
self.label_48.setMinimumSize(QtCore.QSize(130, 50))
font = QtGui.QFont()
font.setFamily("隶书")
font.setPointSize(18)
self.label_48.setFont(font)
self.label_48.setStyleSheet("background:rgb(85, 170, 127);border-radius:15px;")
self.label_48.setObjectName("label_48")
self.scripts = QtWidgets.QLineEdit(self.widget)
self.scripts.setGeometry(QtCore.QRect(148, 82, 307, 50))
self.scripts.setMinimumSize(QtCore.QSize(0, 50))
font = QtGui.QFont()
font.setFamily("Algerian")
font.setPointSize(14)
self.scripts.setFont(font)
self.scripts.setObjectName("scripts")
self.gridLayout_2.addWidget(self.widget, 9, 0, 1, 4)
self.tabWidget.addTab(self.tab_calculator, "")
self.tab_show = QtWidgets.QWidget()
self.tab_show.setObjectName("tab_show")
self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.tab_show)
self.verticalLayout_2.setContentsMargins(0, 0, 0, 0)
self.verticalLayout_2.setObjectName("verticalLayout_2")
self.textEdit = QtWidgets.QTextEdit(self.tab_show)
font = QtGui.QFont()
font.setFamily("楷体")
font.setPointSize(12)
self.textEdit.setFont(font)
self.textEdit.setStyleSheet("border:none")
self.textEdit.setObjectName("textEdit")
self.verticalLayout_2.addWidget(self.textEdit)
self.label_50 = QtWidgets.QLabel(self.tab_show)
font = QtGui.QFont()
font.setFamily("Pristina")
font.setPointSize(24)
self.label_50.setFont(font)
self.label_50.setObjectName("label_50")
self.verticalLayout_2.addWidget(self.label_50)
self.tabWidget.addTab(self.tab_show, "")
MainWindow.setCentralWidget(self.centralwidget)
self.retranslateUi(MainWindow)
self.tabWidget.setCurrentIndex(0)
self.clear.clicked.connect(MainWindow.cleartext)
self.pushButton_2.clicked.connect(MainWindow.savetext)
self.clear_4.clicked.connect(MainWindow.clearText2)
self.pushButton_5.clicked.connect(MainWindow.calcu)
QtCore.QMetaObject.connectSlotsByName(MainWindow)
def retranslateUi(self, MainWindow):
_translate = QtCore.QCoreApplication.translate
MainWindow.setWindowTitle(_translate("MainWindow", "营养科计算助手"))
self.label_0.setText(_translate("MainWindow", "早上"))
self.line0.setPlaceholderText(_translate("MainWindow", "0"))
self.label_3.setText(_translate("MainWindow", "水V"))
self.line1.setPlaceholderText(_translate("MainWindow", "0"))
self.label_11.setText(_translate("MainWindow", "中午"))
self.line2.setPlaceholderText(_translate("MainWindow", "0"))
self.label_2.setText(_translate("MainWindow", "微量"))
self.line3.setPlaceholderText(_translate("MainWindow", "0"))
self.label_5.setText(_translate("MainWindow", "晚上"))
self.line4.setPlaceholderText(_translate("MainWindow", "0"))
self.label_6.setText(_translate("MainWindow", "铁剂"))
self.line5.setPlaceholderText(_translate("MainWindow", "0"))
self.label_4.setText(_translate("MainWindow", "短肽"))
self.line6.setPlaceholderText(_translate("MainWindow", "0"))
self.label_10.setText(_translate("MainWindow", "脂V"))
self.line7.setPlaceholderText(_translate("MainWindow", "0"))
self.label_9.setText(_translate("MainWindow", "全营养"))
self.line8.setPlaceholderText(_translate("MainWindow", "0"))
self.label_8.setText(_translate("MainWindow", "益生菌"))
self.line9.setPlaceholderText(_translate("MainWindow", "0"))
self.label_12.setText(_translate("MainWindow", "乳清"))
self.line10.setPlaceholderText(_translate("MainWindow", "0"))
self.label_13.setText(_translate("MainWindow", "膳食纤维"))
self.line11.setPlaceholderText(_translate("MainWindow", "0"))
self.label_14.setText(_translate("MainWindow", "善存片"))
self.line12.setPlaceholderText(_translate("MainWindow", "0"))
self.label_15.setText(_translate("MainWindow", "谷氨酰胺"))
self.line13.setPlaceholderText(_translate("MainWindow", "0"))
self.label_30.setText(_translate("MainWindow", "自定义一"))
self.line14.setPlaceholderText(_translate("MainWindow", "0"))
self.label_29.setText(_translate("MainWindow", "自定义二"))
self.line15.setPlaceholderText(_translate("MainWindow", "0"))
self.clear.setText(_translate("MainWindow", "清零"))
self.pushButton_2.setText(_translate("MainWindow", "保存"))
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_dangjia), _translate("MainWindow", "单价初始化"))
self.label_46.setText(_translate("MainWindow", "早上"))
self.line0_4.setPlaceholderText(_translate("MainWindow", "0"))
self.label_42.setText(_translate("MainWindow", "水V"))
self.line1_4.setPlaceholderText(_translate("MainWindow", "0"))
self.label_37.setText(_translate("MainWindow", "中午"))
self.line2_4.setPlaceholderText(_translate("MainWindow", "0"))
self.label_38.setText(_translate("MainWindow", "微量"))
self.line3_4.setPlaceholderText(_translate("MainWindow", "0"))
self.label_36.setText(_translate("MainWindow", "晚上"))
self.line4_4.setPlaceholderText(_translate("MainWindow", "0"))
self.label_44.setText(_translate("MainWindow", "铁剂"))
self.line5_4.setPlaceholderText(_translate("MainWindow", "0"))
self.label_40.setText(_translate("MainWindow", "短肽"))
self.line6_4.setPlaceholderText(_translate("MainWindow", "0"))
self.label_47.setText(_translate("MainWindow", "脂V"))
self.line7_4.setPlaceholderText(_translate("MainWindow", "0"))
self.label_43.setText(_translate("MainWindow", "全营养"))
self.line8_4.setPlaceholderText(_translate("MainWindow", "0"))
self.label_41.setText(_translate("MainWindow", "益生菌"))
self.line9_4.setPlaceholderText(_translate("MainWindow", "0"))
self.label_45.setText(_translate("MainWindow", "乳清"))
self.line10_4.setPlaceholderText(_translate("MainWindow", "0"))
self.label_39.setText(_translate("MainWindow", "膳食纤维"))
self.line11_4.setPlaceholderText(_translate("MainWindow", "0"))
self.label_70.setText(_translate("MainWindow", "善存片"))
self.line12_4.setPlaceholderText(_translate("MainWindow", "0"))
self.label_71.setText(_translate("MainWindow", "谷氨酰胺"))
self.line13_4.setPlaceholderText(_translate("MainWindow", "0"))
self.label_69.setText(_translate("MainWindow", "自定义一"))
self.line14_4.setPlaceholderText(_translate("MainWindow", "0"))
self.label_68.setText(_translate("MainWindow", "自定义二"))
self.line15_4.setPlaceholderText(_translate("MainWindow", "0"))
self.clear_4.setText(_translate("MainWindow", "清零"))
self.pushButton_5.setText(_translate("MainWindow", "计算"))
self.label_49.setText(_translate("MainWindow", " 总价"))
self.label.setText(_translate("MainWindow", "应收合计"))
self.label_48.setText(_translate("MainWindow", "套用代码"))
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_calculator), _translate("MainWindow", "总价计算"))
self.textEdit.setPlaceholderText(_translate("MainWindow", "Author :liuzeng"))
self.label_50.setText(_translate("MainWindow", "Author:liuzeng"))
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_show), _translate("MainWindow", "计算显示"))
def filewrite(filename,content):
try:
os.remove(filename)
except Exception as e:
pass
with open(filename,'w') as f:
json.dump(content,f)
def fileread(filename):
if os.path.exists(filename):
with open(filename,'r') as f:
data = json.load(f)
return data
def calc(number):
#number = float(input(">>>输入计算金额: "))
result1 =int( number //38 )
MedNumber = number - result1 * 38
result2 =int( MedNumber // 5)
if result2 *5 +result1 * 38 < number:
result2 +=1
result = result2*5 +result1* 38
return result1,result2,result
def show_result(perPrice,calPrice):
resultstr = ''
name = ['早上','水v','中午','微量','晚上','铁剂','短肽','脂V','全营养','益生菌','乳清','膳食纤维','善存片','谷氨酰胺','自定义一','自定义二']
for name ,price ,num in zip(name,perPrice.values(),calPrice.values()):
if not price:
price = 0
if not num :
num = 0
result = float(price) * float(num)
resultstr = resultstr + '%s 的单价为 %s, 数量为 %s ,总价为 %s\n'%(name,str(price) , str(num) ,str(result))
return resultstr
class Main(QMainWindow,Ui_MainWindow):
def __init__(self):
super(Main,self).__init__()
self.setupUi(self)
self.price.setReadOnly(True)
self.scripts.setReadOnly(True)
self.receviable.setReadOnly(True)
self.textEdit.setReadOnly(True)
regx = QRegExp('[0-9][0-9\.]+$')
pregx = QRegExpValidator(self)
pregx.setRegExp(regx)
self.line0.setValidator(pregx)
self.line1.setValidator(pregx)
self.line2.setValidator(pregx)
self.line3.setValidator(pregx)
self.line4.setValidator(pregx)
self.line5.setValidator(pregx)
self.line6.setValidator(pregx)
self.line7.setValidator(pregx)
self.line8.setValidator(pregx)
self.line9.setValidator(pregx)
self.line10.setValidator(pregx)
self.line11.setValidator(pregx)
self.line12.setValidator(pregx)
self.line13.setValidator(pregx)
self.line14.setValidator(pregx)
self.line15.setValidator(pregx)
self.line0_4.setValidator(pregx)
self.line1_4.setValidator(pregx)
self.line2_4.setValidator(pregx)
self.line3_4.setValidator(pregx)
self.line4_4.setValidator(pregx)
self.line5_4.setValidator(pregx)
self.line6_4.setValidator(pregx)
self.line7_4.setValidator(pregx)
self.line8_4.setValidator(pregx)
self.line9_4.setValidator(pregx)
self.line10_4.setValidator(pregx)
self.line11_4.setValidator(pregx)
self.line12_4.setValidator(pregx)
self.line13_4.setValidator(pregx)
self.line14_4.setValidator(pregx)
self.line15_4.setValidator(pregx)
def cleartext(self):
self.line0.setText('')
self.line1.setText('')
self.line2.setText('')
self.line3.setText('')
self.line4.setText('')
self.line5.setText('')
self.line6.setText('')
self.line7.setText('')
self.line8.setText('')
self.line9.setText('')
self.line10.setText('')
self.line11.setText('')
self.line12.setText('')
self.line13.setText('')
self.line14.setText('')
self.line15.setText('')
try:
os.remove('price.json')
except Exception as e:
pass
perPrice = {}
perPrice['line0'] = self.line0.text()
perPrice['line1'] = self.line1.text()
perPrice['line2'] = self.line2.text()
perPrice['line3'] = self.line3.text()
perPrice['line4'] = self.line4.text()
perPrice['line5'] = self.line5.text()
perPrice['line6'] = self.line6.text()
perPrice['line7'] = self.line7.text()
perPrice['line8'] = self.line8.text()
perPrice['line9'] = self.line9.text()
perPrice['line10'] = self.line10.text()
perPrice['line11'] = self.line11.text()
perPrice['line12'] = self.line12.text()
perPrice['line13'] = self.line13.text()
perPrice['line14'] = self.line14.text()
perPrice['line15'] = self.line15.text()
filewrite('price.json', perPrice)
def savetext(self):
global perPrice
perPrice = {}
perPrice['line0'] =self.line0.text()
perPrice['line1'] =self.line1.text()
perPrice['line2'] =self.line2.text()
perPrice['line3'] =self.line3.text()
perPrice['line4'] =self.line4.text()
perPrice['line5'] =self.line5.text()
perPrice['line6'] =self.line6.text()
perPrice['line7'] =self.line7.text()
perPrice['line8'] =self.line8.text()
perPrice['line9'] =self.line9.text()
perPrice['line10'] =self.line10.text()
perPrice['line11'] =self.line11.text()
perPrice['line12'] =self.line12.text()
perPrice['line13'] =self.line13.text()
perPrice['line14'] =self.line14.text()
perPrice['line15'] =self.line15.text()
filewrite('price.json',perPrice)
return perPrice
def clearText2(self):
self.line0_4.setText('')
self.line1_4.setText('')
self.line2_4.setText('')
self.line3_4.setText('')
self.line4_4.setText('')
self.line5_4.setText('')
self.line6_4.setText('')
self.line7_4.setText('')
self.line8_4.setText('')
self.line9_4.setText('')
self.line10_4.setText('')
self.line11_4.setText('')
self.line12_4.setText('')
self.line13_4.setText('')
self.line14_4.setText('')
self.line15_4.setText('')
def calcu(self):
perPrice = fileread('price.json')
print(perPrice)
global calPrice
calPrice = {}
calPrice['line0_4'] =self.line0_4.text()
calPrice['line1_4'] =self.line1_4.text()
calPrice['line2_4'] =self.line2_4.text()
calPrice['line3_4'] =self.line3_4.text()
calPrice['line4_4'] =self.line4_4.text()
calPrice['line5_4'] =self.line5_4.text()
calPrice['line6_4'] =self.line6_4.text()
calPrice['line7_4'] =self.line7_4.text()
calPrice['line8_4'] =self.line8_4.text()
calPrice['line9_4'] =self.line9_4.text()
calPrice['line10_4'] =self.line10_4.text()
calPrice['line11_4'] =self.line11_4.text()
calPrice['line12_4'] =self.line12_4.text()
calPrice['line13_4'] =self.line13_4.text()
calPrice['line14_4'] =self.line14_4.text()
calPrice['line15_4'] =self.line15_4.text()
money = 0
for price,num in zip(perPrice.values(),calPrice.values()):
if not price:
price = 0
if not num :
num = 0
#print(price,num)
try:
result = float(price) * float(num)
except Exception as e :
print('ERROR:',e)
result = 0
money = money + result
print (money)
res1,res2,res = calc(money)
scriptstext = '38 * %s + 5 * %s '%(str(res1),str(res2))
self.price.setText(str(money))
self.scripts.setText(scriptstext)
self.receviable.setText(str(res))
resultstr = show_result(perPrice,calPrice)
scr = '\n\n'+ '总价为 ' + str(money) + '\n' + '套用代码为 :' + scriptstext +'\n' + '应收合计为 :' + str(res)
resultstr = resultstr +scr
self.textEdit.setText(resultstr)
def main():
app =QApplication(sys.argv)
win = Main()
win.show()
sys.exit(app.exec_())
if __name__ == '__main__':
while True:
main()
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。