保存到外部 PY 文件?
我正在在线服务器上工作,我需要保存所有列表和字典。解决这个问题最好、最快的方法是什么?
我尝试导入数据,并且可以加载数据。但如何更新导入的文件呢?
I'm working on a online server, and I need all my list and dict saved. What would be the best and quickest way to approach this?
I tried importing the data, and it works to load the data. But how can I update the imported file?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为你可以使用pickle/cPickle模块来保存和加载日期,它们是内置模块并且易于使用。
我不太清楚更新导入文件的含义,请问在程序中更新后将内容重写回文件中怎么样?
I think you can use pickle/cPickle module to save and load the date, which are built-in module and easy to use.
I am not very sure the meaning of update import file, what about rewrite the content back to the file after updating in the program?