A script language of time-sharing scheduling coroutine in single thread
j = Import('json');
j.encode(array);
Input:
array
- must be an array (regular array or dict).Return value:
false
returned.Error:
j.decode(s);
Input:
s
- must be a string.Return value:
false
returned.Error:
j = Import('json');
sys = Import('sys');
a = ['name': 'Tom', 'age': 18, 'gender': 'male'];
json = j.encode(a);
sys.print(json);
sys.print(j.decode(json));
The output is:
{"age":18.000000,"name":"Tom","gender":"male"}
[18.000000, Tom, male, ]