w3robotics commited on
Commit
00e8820
·
verified ·
1 Parent(s): 381fb97

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -11
app.py CHANGED
@@ -20,19 +20,15 @@ def upload_file():
20
  # File Delete
21
  @st.dialog("Delete a File")
22
  def delete_file():
23
- # List all files in directory and subdirectories
24
- files = []
25
  for root, dirs, file_names in os.walk(path):
26
  for file_name in file_names:
27
- files.append(file_name)
28
-
29
- st.write(files)
30
- file_to_delete = st.text_input("Enter File Name to Delete:")
31
- if st.button("Delete"):
32
- # Delete the file
33
- os.remove(os.path.join(path,file_to_delete))
34
- st.rerun()
35
-
36
  # File View
37
  @st.dialog("Files used by AI")
38
  def view_file():
 
20
  # File Delete
21
  @st.dialog("Delete a File")
22
  def delete_file():
23
+ # List all files in directory and subdirectories as buttons
24
+
25
  for root, dirs, file_names in os.walk(path):
26
  for file_name in file_names:
27
+ if st.button(file_name):
28
+ # Delete the file
29
+ os.remove(os.path.join(path,file_to_delete))
30
+ st.rerun()
31
+
 
 
 
 
32
  # File View
33
  @st.dialog("Files used by AI")
34
  def view_file():