from PyQt5.QtWidgets import (QApplication, QWidget, QTableWidget,QPushButton, QVBoxLayout, QTableWidgetItem) from PyQt5.QtGui import QPixmap, QPainter, QImage, QTextDocument from PyQt5.QtPrintSupport import QPrinter, QPrintDialog, QPrintPreviewDialog…