Answer the question
In order to leave comments, you need to log in
How to make openpyxl save data to excel?
There is a function that creates an excel file and sends data there.
Only it is called many times because of this, the data is not saved, I need a function to save the data, and when the program ends, it will save the data to a file
from openpyxl import Workbook
def excel_write(name, doljnost, place, money_min, money_max, money_for_hour_min, money_for_hour_max, url):
wb = Workbook()
ws = wb.active
ws['A1'] = 'Название'
ws['B1'] = 'Должность'
ws['C1'] = 'Место'
ws['D1'] = 'Зарплата min'
ws['E1'] = 'Зарплата max'
ws['F1'] = 'Зарплата За час, min'
ws['G1'] = 'Зарплата За час, max'
ws['H1'] = 'Ссылка'
ws.append([name, doljnost, place, money_min, money_max, money_for_hour_min, money_for_hour_max, url])
wb.save("sample1.xlsx")
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question