Seralization

2015-05-09 Thread Cecil Westerhof
To make serialization a bit easier I made a few functions to get, save and convert between the different types. As I see it pickle and json are probably used the most. I also have a get and save for marshal. But no conversion to marshal, because in principle you should not use it, so a conversion

Re: Seralization

2015-05-09 Thread Cecil Westerhof
Op Saturday 9 May 2015 11:16 CEST schreef Chris Angelico: On Sat, May 9, 2015 at 6:37 PM, Cecil Westerhof ce...@decebal.nl wrote: The code: def get_json(json_file): with open(json_file, 'rb') as in_f: return json.load(in_f) def get_marshal(marshal_file): with open(marshal_file, 'rb') as

Re: Seralization

2015-05-09 Thread Chris Angelico
On Sat, May 9, 2015 at 6:37 PM, Cecil Westerhof ce...@decebal.nl wrote: The code: def get_json(json_file): with open(json_file, 'rb') as in_f: return json.load(in_f) def get_marshal(marshal_file): with open(marshal_file, 'rb') as in_f: return

Re: Seralization

2015-05-09 Thread Cecil Westerhof
Op Saturday 9 May 2015 10:37 CEST schreef Cecil Westerhof: To make serialization a bit easier I made a few functions to get, save and convert between the different types. As I see it pickle and json are probably used the most. I also have a get and save for marshal. But no conversion to