Dears,
How to remove row from excel using Python/PySimpleGUI. Knowing that I'm using the reverse process of adding rows to excel file using PySimple :
Add Row :
import PySimpleGUI as sg import pandas as pd .......... [sg.Button('Submit', size=(6, 1), button_color=('White','Dark'))] if event == 'Submit': new_record = pd.DataFrame(values, index=[0]) df = pd.concat([df, new_record], ignore_index=True) df.to_excel(EXCEL_FILE, index=False) sg.popup('Data Saved!', font=("Helvetica", 11),text_color='Yellow', no_titlebar=True, button_type=5) clear_input() And for deleting row with a given key , i'm using the following code and didn't help :
if event == 'Delete': df = pd.read_excel(EXCEL_FILE) df = df[df.Column1!= 'ENTRY'] df.to_excel(EXCEL_FILE, index=False) sg.popup('Entry Deleted!') Could you please advice ? Thanks