Skip to content

Instantly share code, notes, and snippets.

@fengxuway
Created August 11, 2016 02:15
Show Gist options
  • Save fengxuway/c91470c5aa85ae29bdfe5c4021c4747d to your computer and use it in GitHub Desktop.
Save fengxuway/c91470c5aa85ae29bdfe5c4021c4747d to your computer and use it in GitHub Desktop.
Python序列化对象
import pickle
data = {'username': 'fengxu'}
s = pickle.dumps(data)
data2 = pickle.loads(s)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment