I want to create a single dictionary from multiple lists containing filesystem paths.
Here are examples for the lists I want to convert:
list1 = ["root_path", "Test", "Subfolder1"]
list2 = ["root_path", "Test", "Subfolder2"]
list3 = ["root_path", "Test", "Subfolder3"]
list4 = ["root_path", "Test", "Subfolder1", "Subfolder1-1"]
list5 = ["root_path", "Test", "Subfolder1", "Subfolder1-1", "Subfolder1-1-1"]
..
The resulting dictionary should have this nested structure:
resulting_dict = {
"root_path": {
"Test": {
"Subfolder1": {
"Subfolder1-1": {
"Subfolder1-1-1": {}
}
},
"Subfolder2": {},
"Subfolder3": {},
}
}
}
Finding it really challenging. Any help?