This is a short tutorial on how to use python to write and read files.
Example
To write the following json data:
1
|
|
To a file named /tmp/data.json
, we will be using this code:
1 2 3 4 5 |
|
When we execute that code, we will find the data inside that file:
1 2 |
|
And if we want to use python to read the data:
1 2 3 4 |
|
When we execute that code, we will see:
1
|
|
Thank You
Thanks for reading, feel free to check out my website, read my newsletter or follow me at @ruanbekker on Twitter.