add write excel/insert
This commit is contained in:
32
write.py
Normal file
32
write.py
Normal file
@ -0,0 +1,32 @@
|
||||
import pandas as pd
|
||||
import xlsxwriter
|
||||
import tkinter as tk
|
||||
from datetime import datetime
|
||||
|
||||
|
||||
|
||||
def write_excel(value_update):
|
||||
today = datetime.now().strftime('%d-%m-%Y_%H-%M')
|
||||
filename = f'Articoli_Modificati{today}.xlsx'
|
||||
workbook = xlsxwriter.Workbook(filename)
|
||||
worksheet = workbook.add_worksheet()
|
||||
|
||||
worksheet.write('A1', 'CODICE (ART_CODICE)')
|
||||
worksheet.write('B1', 'COSTO (PREZZO)')
|
||||
worksheet.write('C1', 'CODICE LISTINO (TLV/TLA_CODICE)')
|
||||
worksheet.write('D1', 'SC1 (TSM_CODICE)')
|
||||
worksheet.write('E1', 'RICARICA1 (TRL_CODICE)')
|
||||
worksheet.write('F1', 'CODICE BARRE')
|
||||
worksheet.write('G1', 'CODICE ALTERNATIVO')
|
||||
worksheet.write('H1', 'TSM_CODICE_LSV')
|
||||
|
||||
for row_index, row_data in enumerate(value_update):
|
||||
|
||||
for col_index, value in enumerate(row_data):
|
||||
worksheet.write(row_index + 1, col_index, value)
|
||||
|
||||
root = tk.Tk()
|
||||
loading_label = tk.Label(root, text="")
|
||||
loading_label.pack(pady=20)
|
||||
loading_label.config(text="Aggiornamento in corso... Attendere...")
|
||||
workbook.close()
|
||||
Reference in New Issue
Block a user