I'm trying to save a Python Object, version 3.6, using Pickle.
I followed this guide: Saving an Object (Data persistence) and I got this message "RecursionError: maximum recursion depth exceeded while calling a Python object"
So I read this "Hitting Maximum Recursion Depth Using Pickle / cPickle" typing this:
import sys
sys.setrecursionlimit(3000)
import pickle
with open('Results_AL.pkl','wb') as output:
pickle.dump(Results_AL,output)
And nothing, I get the same error. I tried to increase the "setrecursionlimit" until I got this error "Kernel died, restarting".
The Results_AL contains a series of tables, that were read from an html file. Is there a kind of limit or an object type I can not save with Pickle? Is there a way to check if I can use Pickle with my object?
I add some details:
Please consider I'm new with Python so feel free to advise me an alternative way. I defined I class just to store my output that I read from an html file. This file comes from an energy simulation with EnergyPlus, I used the "eppy" library to read it. So this is the code:
class Res:
def __init__(self):
self.Tab1=[]
self.Tab2=[]
self.Tab3=[]
Results=Res()
filepath=path+'myfile.htm'
filetable = open(filepath, 'r').read()
tablelist = readhtml.titletable(filetable)
titles = [i[0] for i in tablelist]
Results.Tab1=tablelist[titles=='End Uses']
Here is the link for eppy http://pythonhosted.org/eppy/Outputs_Tutorial.html