How do you undo x = `a` if A is a list?

Skip Montanaro skip at mojam.com
Fri Feb 11 15:53:52 EST 2000


    Warren> Let's suppose I have a list A:
    Warren> a = [ "first", "second", "third" ]

    Warren> And I want to save to a text file on disk the following Exactly
    Warren> into myfile.txt.  I looked at Pickle, but "human readable" is
    Warren> not one of Pickle's features.

Warren,

Check out the eval and execfile builtin functions and the exec statement in
the docs.  One or more of them will do what you want...

Skip Montanaro | http://www.mojam.com/
skip at mojam.com | http://www.musi-cal.com/
"Languages that change by catering to the tastes of non-users tend not to do
so well." - Doug Landauer




More information about the Python-list mailing list