Skip to content

Instantly share code, notes, and snippets.

@RobBlackwell
Created January 31, 2018 16:23
Show Gist options
  • Save RobBlackwell/10a1aeabeb85bbf1a17cc334e5e60acf to your computer and use it in GitHub Desktop.
Save RobBlackwell/10a1aeabeb85bbf1a17cc334e5e60acf to your computer and use it in GitHub Desktop.
Access pickle files in Julia
using PyCall
@pyimport pickle
function mypickle(filename, obj)
out = open(filename,"w")
pickle.dump(obj, out)
close(out)
end
function myunpickle(filename)
r = nothing
@pywith pybuiltin("open")(filename,"rb") as f begin
r = pickle.load(f)
end
return r
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment