[Python] How to persist a data structure to a file in python? [closed]

Discussão em 'Python' iniciado por Stack, Novembro 30, 2024.

  1. Stack

    Stack Membro Participativo

    Let's say I have something like this:

    d = { "abc" : [1, 2, 3], "qwerty" : [4,5,6] }


    What's the correct way to progammatically get that into a file that I can load from python later?

    Can I somehow save it as python source (from within a python script, not manually!), then import it later?

    Or should I use JSON or something?

    Continue reading...

Compartilhe esta Página