How to create file tree from list of (str, int)?
I already tried to find ways to solve this problem, but I managed to find code for working with files, not a list of strings.
Example of input:
[
('dir1\\file.exe', 14680064)
('dir1\\file-1.bin', 4293569534)
('dir1\\file-2.bin', 4294967294)
('dir1\\file-3.bin', 4294967294)
('dir1\\archives\\archive1.zip', 5242880)
('dir1\\archives\\archive2.zip', 525788)
]
Result:
dir1
├──file.exe 14680064 Bytes
├──file-1.bin 4293569534 Bytes
├──file-2.bin 4293569534 Bytes
├──file-3.bin 4293569534 Bytes
└──archives
├──archive1.zip 5242880 Bytes
└──archive2.zip 525788 Bytes