# Auther:aaron Fan
# Deposit data into a file
# JSON-formatted data can be almost universally spoken in any programming language, but simply a simple format conversion
# For example: dictionaries, lists, tuples, strings, and so on, like functions, classes can not be converted.
# python has a module that supports all format conversions: pickle, but the pickle format cannot be used in any other language, only in Python!
# Pickle's use is exactly the same as JSON, just use it to change the JSON to pickle (there is a slight difference between the function and the class when you need to check it out).
# 2.7 The inside dump and load can be saved multiple times and taken multiple times. But 3.x uses JSON to keep in mind one principle: data storage is always dump once, then load once.
# If you really want to save several states, dump several files, and then go to load the files.
Import JSON
info = {
' Name ': ' Aaron ',
' Age ': 21
}
With open (' Test.txt ', ' W ', encoding= ' utf-8 ') as F:
F.write (Json.dumps (info))
# Shopping cart in that program, saving the balance is useful for another way of writing, the function is exactly the same as the wording of the different
Serialization of Python3--json