Streamlit file explorer

Hello!
I am currently working on a streamlit site in Python, but I have no idea how to add a file explorer display into the site. Is there any way where I can identify a directory and I can add code that will allow users to view the files through folders and categories (similar to that of github project file explorer).

import os
import streamlit as st
filelist=[]
for root, dirs, files in os.walk("your folder directory"):
      for file in files:
             filename=os.path.join(root, file)
             filelist.append(filename)
st.write(filelist)
2 Likes