![](/img/trans.png)
[英]Is there a way to view cPickle or Pickle file contents without loading Python in Windows?
[英]Is there any way to restore the deleted contents of a pickle file?
我想阅读泡菜的内容。 在复制和粘贴代码时,我不小心使用了'wb'
代替了'rb'
以读取泡菜文件。
with open("abc_contents.pkl", 'wb') as file:
data = pickle.load(file)
由于我的泡菜文件被覆盖,我丢失了所有内容。 有什么方法可以将文件恢复到以前的版本。
任何帮助表示赞赏。 谢谢你。
没有办法恢复泡菜文件。 如果您不打算覆盖数据,请确保以追加模式ab
打开文件,而不是写入模式wb
。
with open("abc_contents.pkl", 'ab') as file:
data = pickle.load(file)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.