Hi,
I'm very new to this. I have a bit of python code that loads a pickle file which contains a Dataframe with class objects. Below I'll show a simplification of my problem
Module.py
class Module:
def __init__(self,ID):
self.ID = ID
#some other functions
Let's say in an earlier function (in the same file) I have created a dataframe looking like this [ID,Module] and pickled it. Now I want to load that pickle file
def loadList():
moduleList = pickle.load(open('/home/user/mysite/modules.p','rb'))
If I run this I get: AttributeError: Can't get attribute 'Module' on <module 'main' (built-in)>
The code works fine locally but not on PA. Any help is greatly appreciated.
Thanks.
edited: added open() to pickle.load