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

Нужно вывести функцию open file не в консоль а чтоб вывелось в само приложение!!!Пожалуйста помогите[apcode language=»python»]

from lib.drivers import DbDriver
from openpyxl import load_workbook
    class AbonentsModel(DbDriver):
      def __init__(self):
        super().__init__()
      def add_abonent(self, name: str)-> None:
        query = 'INSERT INTO Abonents (name) VALUES(?)'
        params = (name,)
        self.execute_dml_query(query, params)
        print(f"Имя: {name} -  успешно добавлено в таблицу")
        def edit_abonent(self, name: str, fid: int) -> None:
        query = 'UPDATE Faculties SET name=? WHERE id=?'
        params = (name, fid)
        self.execute_dml_query(query, params)
        print('Данные успешно изменены!')
      def delete_abonent(self, fid: int) -> None:
        query = 'DELETE FROM Faculties WHERE id=?'
        params = (fid,)
        self.execute_dml_query(query, params)
        print('Данные успешно удалены!')
      def get_abonent(self, fid: int) -> list:
        query = 'SELECT * FROM Abonents'
        params = (name,fid)
        return self.execute_dql_query(query, params)
      def open_file(self):
          wb = load_workbook('data.xlsx')
        sheets = wb.sheetnames
        sheet = wb.active
        cell = sheet["A"]
        cell = sheet.cell(row=1, column=1)
        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(",", " ")
                print(string)

[/apcode]

Asked question
Добавить комментарий