input and output in python
Python provides several built-in modules for working with files and serializing data in JSON format. In this section, we will explore how to read and write files in Python, and how to use the json module to parse and serialize JSON data. We'll cover basic file I/O operations, advanced techniques for working with large files, and best practices for handling JSON data in Python
Read or watch
- Reading and writing files
- 8.7 Predefined cleanup actions
- Dive into python3: Chapter 11. Files
- Json econder and decoder
- Learn to program 8 - Reading and writting files
- Automate the boring stuff with python
- All about py-file I/O
- Youtube
- Python
By the end of this session, you should be able to explain to anyone without the help of google the following concepts
- Why Python programming is awesome
- How to open a file
- How to write text in a file
- How to read the full content of a file
- How to read a file line by line
- How to move the cursor in a file
- How to make sure a file is closed after using it
- What is and how to use the with statement
- What is JSON
- What is serialization
- What is deserialization
- How to convert a Python data structure to a JSON string
- How to convert a JSON string to a Python data structure