Skip to content

Latest commit

 

History

History

README.md

0x0B. Python - Input/Output

Resources:books:

Read or watch:


Learning Objectives:bulb:

What you should learn from this project:

  • 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

  • Write a function that reads a text file (UTF8) and prints it to stdout:
  • Write a function that writes a string to a text file (UTF8) and returns the number of characters written:
  • Write a function that appends a string at the end of a text file (UTF8) and returns the number of characters added:
  • Write a function that returns the JSON representation of an object (string):
  • Write a function that returns an object (Python data structure) represented by a JSON string:
  • Write a function that writes an Object to a text file, using a JSON representation:
  • Write a function that creates an Object from a “JSON file”:
  • Write a script that adds all arguments to a Python list, and then save them to a file:
  • Write a function that returns the dictionary description with simple data structure (list, dictionary, string, integer and boolean) for JSON serialization of an object:
  • Write a class Student that defines a student by:
  • Write a class Student that defines a student by: (based on 9-student.py)
  • Write a class Student that defines a student by: (based on 10-student.py)
  • Technical interview preparation:
  • Write a function that inserts a line of text to a file, after each line containing a specific string (see example):
  • Write a script that reads stdin line by line and computes metrics:
  • Write a script that finds a string in the heap of a running process, and replaces it.

Author