So I\'ve been tasked with essentially reading in a file (notepad file) that has a bunch of train stops and the time it takes to get from one stop to another. For example it
A dict is perfectly acceptable in this situation. In fact, if a database is unavailable to you and you're interested in reusing this dictionary in the future, you could pickle the object and use it in another script:
import pickle
output = open('my_pickled_dict', 'wb')
pickle.dumb(my_dict, output)
output.close
And then in your next script:
import pickle
my_pickled_file = open('my_pickled_dict', 'rb')
my_dict = pickle.load(my_pickled_file)