Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
davidl.me
David's Wiki
Search
Search
Log in
Personal tools
Log in
Python: Difference between revisions
Page
Discussion
English
Read
View source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
View source
View history
General
Special pages
Printable version
← Older edit
Newer edit →
Python
(view source)
Revision as of 18:27, 2 July 2021
10 bytes added
,
2 July 2021
→JSON
Revision as of 22:37, 1 July 2021
(
view source
)
David
(
talk
|
contribs
)
(
→Exceptions
)
← Older edit
Revision as of 18:27, 2 July 2021
(
view source
)
David
(
talk
|
contribs
)
(
→JSON
)
Newer edit →
Line 514:
Line 514:
# Write to file
# Write to file
with open("my_data.json", "w") as f:
with open("my_data.json", "w") as f:
json.dump(my_data, f)
json.dump(my_data, f
, indent=2
)
# Read from file
# Read from file
David
Bureaucrats
,
Interface administrators
,
Administrators
5,321
edits
Toggle limited content width