How do we extract the data of specific row from excel data to pysimplegui input fileds
Solution 1:
Add option enable_events=True
into you sg.Input
for Name
, then add one more statement in your event loop to check the value of Name
if match any name in column Name
.
if event == 'Name':
name = values['Name']
if name == '':
continue
index = df[df.Name==name].first_valid_index()
if index is not None:
lst = df.iloc[index].to_list()
for key, value in zip(['Name', 'City', 'Favorite Colour', 'German', 'Spanish', 'English', 'Children'], lst):
window[key].update(value)