Page 161 -
P. 161

persistence





                  I guess I could write some custom
                  parsing code to process the “internal
                  format” used by “print()”. It shouldn’t               It might be worth looking at
                                                                        using something other than a plain
                  take me all that long...
                                                                        “print()” to format the data prior
                                                                        to saving it to the data file? I’d
                                                                            certainly look into it.






























           Parsing the data in the file is a possibility…although it’s complicated by all those
           square brackets, quotes, and commas. Writing the required code is doable,
           but it is a lot of code just to read back in your saved data.
           Of course, if the data is in a more easily parseable format, the task would likely be
           easier, so maybe the second option is worth considering, too?









                                   Can you think of a function you created from earlier
                                   in this book that might help here?






                                                                                      you are here 4    125
   156   157   158   159   160   161   162   163   164   165   166