-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.py
More file actions
executable file
·36 lines (27 loc) · 913 Bytes
/
test.py
File metadata and controls
executable file
·36 lines (27 loc) · 913 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/env python3
import jjson
if __name__ == "__main__":
print(f"Welcome to jjson version {jjson.version} by Que's C++ Studio")
print("\ntest read number: ")
print(jjson.loads("123"))
print(jjson.loads("-3.14"))
print(jjson.loads("0x1F"))
print(jjson.loads("1.23E-04"))
print("\ntest read string: ")
print(jjson.loads("'abc'"))
print(jjson.loads("\"a'b\\\"c\""))
print("\ntest read javascript id: ")
print(jjson.loads("id"))
print(jjson.loads("$id"))
print(jjson.loads("true"))
print(jjson.loads("null"))
print("\ntest read list: ")
print(jjson.loads("[]"))
print(jjson.loads("[1, 'a', $id]"))
print("\ntest read dict: ")
print(jjson.loads("{}"))
print(jjson.loads("{'key': 'value', 'key_list': []}"))
print("\ntest read configure file with comment: example.conf")
print(jjson.load("example.conf"))
print("\ntest read js object: example.js")
print(jjson.load("example.js"))