保存到外部 PY 文件?

发布于 2024-12-17 07:20:13 字数 88 浏览 1 评论 0原文

我正在在线服务器上工作,我需要保存所有列表和字典。解决这个问题最好、最快的方法是什么?

我尝试导入数据,并且可以加载数据。但如何更新导入的文件呢?

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

你是我的挚爱i 2024-12-24 07:20:13

我认为你可以使用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?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文