File tree Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -1730,7 +1730,7 @@ JSON
1730
1730
``` python
1731
1731
import json
1732
1732
< str > = json.dumps(< object > , ensure_ascii = True , indent = None )
1733
- < object > = json.loads(< str > ) # Raises ValueError on malformed string.
1733
+ < object > = json.loads(< str > )
1734
1734
```
1735
1735
1736
1736
### Read Object from JSON File
Original file line number Diff line number Diff line change 1554
1554
1555
1555
< div > < h2 id ="json "> < a href ="#json " name ="json "> #</ a > JSON</ h2 > < pre > < code class ="python language-python hljs "> < span class ="hljs-keyword "> import</ span > json
1556
1556
<str> = json.dumps(<object>, ensure_ascii=< span class ="hljs-keyword "> True</ span > , indent=< span class ="hljs-keyword "> None</ span > )
1557
- <object> = json.loads(<str>) < span class =" hljs-comment " > # Raises ValueError on malformed string. </ span >
1557
+ <object> = json.loads(<str>)
1558
1558
</ code > </ pre > </ div >
1559
1559
1560
1560
< div > < h3 id ="readobjectfromjsonfile "> Read Object from JSON File</ h3 > < pre > < code class ="python language-python hljs "> < span class ="hljs-function "> < span class ="hljs-keyword "> def</ span > < span class ="hljs-title "> read_json_file</ span > < span class ="hljs-params "> (filename)</ span > :</ span >
You can’t perform that action at this time.
0 commit comments