Spaces:
Sleeping
Sleeping
| import os | |
| import gradio as gr | |
| def print_flagged_dir_and_csv(x): | |
| dirtree = "" | |
| startpath = "flagged" | |
| for root, dirs, files in os.walk(startpath): | |
| level = root.replace(startpath, '').count(os.sep) | |
| indent = ' ' * 4 * (level) | |
| dirtree += '{}{}/\n'.format(indent, os.path.basename(root)) | |
| subindent = ' ' * 4 * (level + 1) | |
| for f in files: | |
| dirtree += '{}{}\n'.format(subindent, f) | |
| return dirtree | |
| gr.Interface(print_flagged_dir_and_csv, "textbox", "textbox", allow_flagging=True).launch() |