0
0 комментариев

Помогите сделать код чтоб при нажатии на кнопку в функции выводилось значение колонок ексель[apcode language=»python»]

# -*- coding: utf-8 -*-
 import sys
from PyQt5.QtCore import pyqtSlot
from openpyxl import load_workbook
 from PyQt5.QtWidgets import QApplication, QDialog
from PyQt5.uic import loadUi
 class Life2Coding(QDialog):
    def __init__(self):
        super(Life2Coding, self).__init__()
        loadUi("life2coding.ui", self)
        self.setWindowTitle("COMPANY")
        self.pushButton.clicked.connect(self.on_pushButton_clicked)
     @pyqtSlot()
    def on_pushButton_clicked(self):
        self.setText(self, width=100, height=50, font="12")
        wb = load_workbook('data.xlsx')
        sheet = wb.sheetnames
        sheet = wb.active
        #for elem in range(2, 6):
            #i = 0
        for word in sheet[81:84]:
            string = " "
            for cell in word:
                string = str(cell.value)
                string = string.replace("0.0000", "  ")
                string = string.replace(",,,", " ")
                string = string.replace(",", " ")
                string = string.replace("Контракт", "1.Контракт")
            txt.insert(loadUi().END,"{}{}{}{}".format(string,"   "," ", "\n"))
 app = QApplication(sys.argv)
widget = Life2Coding()
widget.show()
sys.exit(app.exec())

[/apcode]

Решенный вопрос
Добавить комментарий