simplejson.loads() get Invalid \\escape: 'x'
I am learning how to use simplejson to decode JSON file. But I suffered the "invalid \escape" error. Here is the code import simplejson as json def main(): json.loads(r'{"test":"\x27"}') if __name__ == '__main__': main() And here is the error message Traceback (most recent call last): File "hello_world.py", line 7, in <module> main() File "hello_world.py", line 4, in main json.loads(r'{"test":"\x27"}') File "C:\Users\zhangkai\python\simplejson\__init__.py", line 307, in loads return _default_decoder.decode(s) File "C:\Users\zhangkai\python\simplejson\decoder.py", line 335, in decode obj, end =