Are there any methods or plugins that allow me to transform a directory with files and other directories inside (including if I hear something inside them) into an object in python?
I want to pass a list with all the files and directories of a specific path, with name, size and its complete path, is there any simple way to do it? What would be the best way to resolve this?
exemple:
/app
-file1
-file2
-dir1
-dir2
-file3
-file4
to:
obj=[
{name=file1, size= 10kb, path='/app/file1'},
...,
{name=dir1, size= 100kb, path='/app/dir1', child={name=file4, size= 10kb, path='/app/file4'} ,...}
]