I am trying to have an app that loops through a directory (folder and sub) searching for multiple extensions or keywords and outputs the list in a dynamic frame but the code (or returns Zero if nothing found).
Current code fails both when multiple extensions (or keywords) are inputted or fails by grouping multiple results in a single row of the frame.
I need help in debugging my code posted below.
Thank you
from st_aggrid import AgGrid
import streamlit as st
import pandas as pd
import os
office= st.text_input("Enter your Office : ")
path= st.text_input("Enter directory path to search : ")
extensions= st.text_input("Enter the File Extension :")
file_names = [fn for fn in os.listdir(path) if any(fn.endswith(ext) for ext in extensions)]
df = pd.DataFrame({'Office' : [office],'Directory' : [path],'File_Name' : file_names})
AgGrid(df, fit_columns_on_grid_load=True)