mirror of
https://github.com/kennethreitz/dive-into-python3.git
synced 2026-06-05 15:00:18 +00:00
validation typo
This commit is contained in:
+1
-1
@@ -351,7 +351,7 @@ def protocol_version(file_object):
|
||||
<samp class=p>>>> </samp><kbd class=pp>shell</kbd>
|
||||
<samp class=pp>1</samp>
|
||||
<samp class=p>>>> </samp><kbd class=pp>with open('basic-pretty.json', mode='w', encoding='utf-8') as f:</kbd>
|
||||
<a><samp class=p>... </samp><kbd class=pp> json.dump(basic_entry, f, <mark style="display:inline">indent=2</mark>) <span class=u>①</span></a></kbd></pre>
|
||||
<a><samp class=p>... </samp><kbd class=pp> json.dump(basic_entry, f, <mark style="display:inline">indent=2</mark>)</kbd> <span class=u>①</span></a></pre>
|
||||
<ol>
|
||||
<li>If you pass an <var>indent</var> parameter to the <code>json.dump()</code> function, it will make the resulting <abbr>JSON</abbr> file more readable, at the expense of larger file size. The <var>indent</var> parameter is an integer. 0 means “put each value on its own line.” A number greater than 0 means “put each value on its own line, and use this number of spaces to indent nested data structures.”
|
||||
</ol>
|
||||
|
||||
Reference in New Issue
Block a user