def save ( self , fname ) : with open ( fname , 'wb' ) as f : json . dump ( self , f )
how to save dictionary of object to file python
Saves the dictionary in json format : param fname : file to save to
def save(self, fname):
        """ Saves the dictionary in json format
        :param fname: file to save to
        """
        with open(fname, 'wb') as f:
            json.dump(self, f)