cPickle Module

Hi ive been playing around, trying to understand a version of WSAG. However I have a question. The start of the scripts looks like this

import bge
from bge import logic
from socket import *
from cPickle import *

I get error message saying: no module named cPickle
I try to change some thing. Just import cPickle, import Pickle does not work either.
Ive looked on the web for the module and how to use it but have come up unsuccessful. I assumed it would just be a file called Cpickle.py and I would place it in the active directory with my project. But I cant find anything on it

Any suggestions?

It’s now called ‘pickle’ in python3

Thanks agoose :smiley:

Um, not quite. cPickle is still there its just called _pickle

I ought to read the documentation more.
“The pickle module has an optimized cousin called the cPickle module. As its name implies, cPickle is written in C, so it can be up to 1000 times faster than pickle.”

When importing “pickle” in Python3, it first attempts to use the C implementation. Otherwise, it will fallback to the Python implementation. In other words, the Pickle module now uses the fasted implementation available, and you no longer need to explicitly import “cPickle”.

That’s useful. I thought it unusual to deprecate a module silently like that.