Hi StepIre,
You could use the pickle module, which serializes and saves data structures, effectively allowing you to skip the whole messy business of file parsing. Example:
import pickle
# If you want to store a dictionary in a file...
d = { "a":"aardvark", "b":"ball", "c":"centurion" }
f = open("somefile.dat", "w")
pickle.dump(d, f)
f.close()
# If you want to load the stored dictionary...
f = open("somefile.dat", "r")
d = pickle.load(f)
f.close()
print d["a"] # prints 'aardvark'
Is this what you were looking for?
Hope this helps!