Интерфейс:
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtWidgets import QApplication, QMainWindow, QFileDialog, QWidget, QMessageBox, QGraphicsView, QGraphicsScene, QGraphicsPixmapItem, QVBoxLayout, QTableWidget, QTableWidgetItem, QMenu, QMenuBar, QAction
from PyQt5.QtGui import QPixmap, QImage
import sys
import logo
import os
import openpyxl
from PIL import Image
import cv2
from open import show_photo
import xlrd
from PyQt5.Qt import *
from xlsxwriter.workbook import Workbook
import cv2
import numpy as np
class Ui_MainsWindow(object):
def setupUi(self, MainsWindow):
MainsWindow.setObjectName("Getera Program")
MainsWindow.resize(1920, 1080)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(MainsWindow.sizePolicy().hasHeightForWidth())
MainsWindow.setSizePolicy(sizePolicy)
MainsWindow.setMinimumSize(QtCore.QSize(800, 800))
MainsWindow.setStyleSheet("background-color:rgb(129, 129, 129)")
MainsWindow.setIconSize(QtCore.QSize(24, 24))
self.centralwidget = QtWidgets.QWidget(MainsWindow)
self.centralwidget.setObjectName("centralwidget")
self.line = QtWidgets.QFrame(self.centralwidget)
self.line.setGeometry(QtCore.QRect(50, 0, 20, 41))
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.line.sizePolicy().hasHeightForWidth())
self.line.setSizePolicy(sizePolicy)
self.line.setStyleSheet("background-color:rgb(149, 149, 149);")
self.line.setFrameShape(QtWidgets.QFrame.VLine)
self.line.setFrameShadow(QtWidgets.QFrame.Sunken)
self.line.setObjectName("line")
self.label = QtWidgets.QLabel(self.centralwidget)
self.label.setGeometry(QtCore.QRect(0, 0, 1921, 41))
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.label.sizePolicy().hasHeightForWidth())
self.label.setSizePolicy(sizePolicy)
self.label.setStyleSheet("background-color:rgb(149, 149, 149);")
self.label.setText("")
self.label.setObjectName("label")
self.pushButton = QtWidgets.QPushButton(self.centralwidget)
self.pushButton.setGeometry(QtCore.QRect(70, 10, 81, 21))
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.pushButton.sizePolicy().hasHeightForWidth())
self.pushButton.setSizePolicy(sizePolicy)
font = QtGui.QFont()
font.setFamily("Arial Black")
font.setPointSize(9)
font.setBold(True)
font.setWeight(75)
self.pushButton.setFont(font)
self.pushButton.setStyleSheet("background-color:rgb(209, 209, 209);")
self.pushButton.setObjectName("pushButton")
self.pushButton_3 = QtWidgets.QPushButton(self.centralwidget)
self.pushButton_3.setGeometry(QtCore.QRect(250, 10, 81, 21))
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.pushButton_3.sizePolicy().hasHeightForWidth())
self.pushButton_3.setSizePolicy(sizePolicy)
font = QtGui.QFont()
font.setFamily("Arial Black")
font.setPointSize(9)
font.setBold(True)
font.setWeight(75)
self.pushButton_3.setFont(font)
self.pushButton_3.setStyleSheet("background-color:rgb(209, 209, 209);")
self.pushButton_3.setObjectName("pushButton_3")
#Frame new
self.col = QtWidgets.QFrame(self.centralwidget)
self.col.setGeometry(QtCore.QRect(500, 100, 400, 400))
self.col.setStyleSheet("background-color:rgb(149, 149, 149);")
#создание таблицы
self.table = QtWidgets.QTableWidget(self.centralwidget)
self.table.setColumnCount(6)
self.table.setRowCount(10000)
self.table.setHorizontalHeaderLabels(["A","B","C","D"])
sizePolicy.setHorizontalStretch(400)
sizePolicy.setVerticalStretch(400)
self.table.setGeometry(QtCore.QRect(10, 50, 460, 1000))
self.table.setSizePolicy(sizePolicy)
self.table.setStyleSheet("background-color:rgb(209, 209, 209);")
self.label_2 = QtWidgets.QLabel(self.centralwidget)
self.label_2.setGeometry(QtCore.QRect(10, 0, 41, 41))
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.label_2.sizePolicy().hasHeightForWidth())
self.label_2.setSizePolicy(sizePolicy)
self.label_2.setStyleSheet("background-color:rgb(149, 149, 149);")
self.label_2.setText("")
self.label_2.setPixmap(QtGui.QPixmap(":/newPrefix/logo.ico"))
self.label_2.setScaledContents(True)
self.label_2.setObjectName("label_2")
self.pushButton_4 = QtWidgets.QPushButton(self.centralwidget)
self.pushButton_4.setGeometry(QtCore.QRect(160, 10, 81, 21))
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.pushButton_4.sizePolicy().hasHeightForWidth())
self.pushButton_4.setSizePolicy(sizePolicy)
font = QtGui.QFont()
font.setFamily("Arial Black")
font.setPointSize(9)
font.setBold(True)
font.setWeight(75)
self.pushButton_4.setFont(font)
self.pushButton_4.setStyleSheet("background-color:rgb(209, 209, 209);")
self.pushButton_4.setObjectName("pushButton_4")
self.line_2 = QtWidgets.QFrame(self.centralwidget)
self.line_2.setGeometry(QtCore.QRect(50, 0, 20, 41))
self.line_2.setStyleSheet("background-color:rgb(149, 149, 149);")
self.line_2.setFrameShape(QtWidgets.QFrame.VLine)
self.line_2.setFrameShadow(QtWidgets.QFrame.Sunken)
self.line_2.setObjectName("line_2")
MainsWindow.setCentralWidget(self.centralwidget)
self.statusbar = QtWidgets.QStatusBar(MainsWindow)
self.statusbar.setObjectName("statusbar")
MainsWindow.setStatusBar(self.statusbar)
self.retranslateUi(MainsWindow)
QtCore.QMetaObject.connectSlotsByName(MainsWindow)
def retranslateUi(self, MainsWindow):
_translate = QtCore.QCoreApplication.translate
MainsWindow.setWindowTitle(_translate("MainsWindow", "MainsWindow"))
self.pushButton.setText(_translate("MainsWindow", "Open"))
self.pushButton_3.setText(_translate("MainsWindow", "Map"))
self.pushButton_4.setText(_translate("MainsWindow", "Save"))