Is there an alternative to pickle - save a dictionary (python)
Question: I need to save a dictionary to a file, In the dictionary there are strings,
integers, and dictionarys.

I did it by my own and it's **not** pretty and nice to user.

I know about pickle but as I know it is not safe to use it, because if someone
_replace the file_ and I (or someone else) will run the file that uses the
_replaced file_ , It will be running and might do some things. **it's just not
safe.**

Is there another function or imported thing that does it.


Answer: Pickle is not safe when _transfered by a untrusted 3rd party_. Local files are
just fine, and if something can replace files on your filesystem then you have
a different problem.

That said, if your dictionary contains nothing but string keys and the values
are nothing but Python lists, numbers, strings or other dictionaries, then use
JSON, via the [`json` module](http://docs.python.org/2/library/json.html).

