Quantcast
Channel: Scripting - McNeel Forum
Viewing all articles
Browse latest Browse all 5820

Saving class instance with pickle

$
0
0

@raylee14 wrote:

Hi everyone,

I saved a mesh and a class instance with pickle to a pickle file:

with open(‘test.pickle’, ‘wb’) as fileout:
pickle.dump(mesh, fileout)

with open(‘test.pickle’, ‘rb’) as filein:
myfile = pickle.load(filein)

however, I got the following errors when I call back the file:

Runtime error (NullReferenceException): Object reference not set to an instance of an object.

Traceback (most recent call last):
SystemError: Object reference not set to an instance of an object.

When calling back a class instance:
Runtime error (ImportException): No module named main

Traceback:
line 1130, in find_class, “C:\Program Files\Rhino 6\Plug-ins\IronPython\Lib\pickle.py”
line 1075, in load_inst, “C:\Program Files\Rhino 6\Plug-ins\IronPython\Lib\pickle.py”
line 864, in load, “C:\Program Files\Rhino 6\Plug-ins\IronPython\Lib\pickle.py”
line 1384, in load, “C:\Program Files\Rhino 6\Plug-ins\IronPython\Lib\pickle.py”
line 19, in script

those errors appear when i call back the files

Posts: 3

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 5820

Trending Articles