List to String and Back

Hi folks:
Once again, working w/Python in Maya, a 3D animation app.
I'm using a potentially time-consuming procedure to generate a list of commands, and I want to store the list in the Maya file.
The best solution I can think of is to convert the list to a string, which I can easily store and convert back to a list when I need it.
The items in the list are enclosed by tildes, which are necessary to define them as commands.
A simple example:

Gribouillis method would probably be the best way. I'm still considered novice at programming, and using Gribouillis method would probably return faster than mine.

I don't know if it's faster, but Pickle can serialize lists containing more complex data. Also it's commonly used to convert python objects to strings when you want to send them through a network connection.

I don't know if it's faster, but Pickle can serialize lists containing more complex data. Also it's commonly used to convert python objects to strings when you want to send them through a network connection.

I'm a Python newbie, but it seems to me pickle is the way to go. Also, the reconstituted list doesn't contain an extra element.
Thanks again.