Loading python pickled object in C
问题 I know pickles can be easily loaded into python using import pickle p = pickle.load(open("file.pkl")) I was wondering how to load the same pickle file in pyx/C code in python? I couldn't find the method to directly load it. Perhaps a solution would be to load in python and pass reference to object in C? 回答1: The easy answer would be to just compile your code with Cython. Everything there will be done automatically. In context of the Python C API, you could easily replicate this code with