摘要: shelve提供python的持久化操作. 什么叫持久化操作呢? 说白话,就是把数据写到硬盘上. 在操作shelve的时候非常的像操作一个字典. 这个东⻄到后期. 就像redis差不多. 字典怎么用shelve就怎么用 import shelve shelf = shelve.open("sylar 阅读全文
posted @ 2018-11-15 20:19 风光暖阳 阅读(242) 评论(0) 推荐(0) 编辑
摘要: pickle⽤起来很简单. 说⽩了. 就是把我们的python对象写入到⽂件中的⼀种解决方案. 但是写入到⽂件的是bytes. 所以这东⻄不是给人看的. 是给机器看的. import pickle class Cat: def __init__(self, name, age): self.name 阅读全文
posted @ 2018-11-15 20:18 风光暖阳 阅读(215) 评论(0) 推荐(0) 编辑