search

Home  >  Q&A  >  body text

在python生成了一个大字典,后续需要操作这个字典,怎么办才能不需要重复生成字典的操作呢?

python新手求助。生成了100万个名字和ID号码对应的大字典,花了好长时间,后续需要根据这个字典进行操作,要如何在编写后续代码时不需要重复生成这个字典呢?

大家讲道理大家讲道理2897 days ago561

reply all(1)I'll reply

  • ringa_lee

    ringa_lee2017-04-18 09:50:58

    This is a storage issue!

    To be simpler, you can use python's own pickle storage method to store the dictionary file as a local file.
    However, it is recommended to use sqlite or mysql database for storage, which will make the operation more convenient.

    reply
    0
  • Cancelreply