Python Forum
How can I create a linked list that contains each folder with its files?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How can I create a linked list that contains each folder with its files?
#6
(Dec-25-2021, 07:55 AM)noahverner1995 Wrote: Well, that would work indeed, but how can a program manage to get the data from the folders in the path provided into that linked list?
Well, that is easy. You have done a good job. In line 24 (print(list_of_file_contents)) you have all the data you need.
So just after "# Main method" you add a line to create the dictionary:
the_linked_list = {}
... And after line "print(list_of_file_contents)" you fill the dictionary:
the_linked_list[path] = list_of_file_contents
That should do it. You don't need the lines after "# Get files and add directory to LL".
And again: this is not a "linked list", it is a dictionary.
noahverner1995 likes this post
Reply


Messages In This Thread
RE: How can I create a linked list that contains each folder with its files? - by ibreeden - Dec-25-2021, 09:42 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
Star Little help with my code - Linked List SantiagoPB 1 2,227 Mar-14-2021, 01:20 PM
Last Post: BashBedlam
  Linked List - Ordering by largest population with country name. PaleHorse 2 3,079 Jun-16-2020, 09:04 PM
Last Post: jefsummers
  iterating through all files from a folder gonzo620 10 8,482 Nov-06-2018, 01:48 AM
Last Post: gonzo620
  create a 20 digit string, and cast to a list then add all the digits as integers nikhilkumar 2 6,479 Jul-19-2017, 04:53 PM
Last Post: nilamo

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020