Ce cours n'est pas disponible en Français (France)

Nous sommes actuellement en train de le traduire dans plus de langues.
Packt

Reading and Writing Files

Inclus avec Coursera Plus

Obtenez un aperçu d'un sujet et apprenez les principes fondamentaux.
niveau Débutant

Expérience recommandée

6 heures à compléter
Planning flexible
Apprenez Ă  votre propre rythme
Obtenez un aperçu d'un sujet et apprenez les principes fondamentaux.
niveau Débutant

Expérience recommandée

6 heures à compléter
Planning flexible
Apprenez Ă  votre propre rythme

Ce que vous apprendrez

  • Master how to open, read, and close files in Python efficiently.

  • Learn how to write single and multiple lines of data to files safely.

  • Understand the use of context managers to handle files effectively.

  • Explore techniques for looping through multiple files for batch processing.

Compétences que vous acquerrez

  • CatĂ©gorie : Data Import/Export
  • CatĂ©gorie : File I/O
  • CatĂ©gorie : File Management
  • CatĂ©gorie : Context Management

Outils que vous découvrirez

  • CatĂ©gorie : Python Programming

Détails à connaître

Certificat partageable

Ajouter Ă  votre profil LinkedIn

Récemment mis à jour !

avril 2026

Évaluations

8 devoirs

Enseigné en Anglais

Découvrez comment les employés des entreprises prestigieuses maîtrisent des compétences recherchées

 logos de Petrobras, TATA, Danone, Capgemini, P&G et L'Oreal

Il y a 7 modules dans ce cours

In this module, we will introduce you to the fundamentals of file handling in Python. You will learn how to open and close files, and explore the various modes in which files can be accessed. Additionally, we will cover methods for manipulating file content, providing you with a solid foundation to work with files in Python.

Inclus

2 vidéos1 lecture

In this module, we will dive into reading data from files in Python. You will explore various techniques for reading file content, including best practices to ensure efficiency and reliability. By the end, you'll have a clear understanding of how to effectively read and manipulate data from files.

Inclus

1 vidéo1 devoir

In this module, we will focus on writing data to files in Python. You will learn how to write both single and multiple lines of data to a file, as well as discover potential challenges that can arise in the process. By the end, you'll be able to write data efficiently and avoid common mistakes.

Inclus

1 vidéo1 devoir

In this module, we will explore the power of context managers in Python for efficient file handling. You will learn how to use context managers to automatically handle file opening and closing, which reduces the risk of errors and simplifies your code. By the end, you’ll be able to utilize context managers to streamline your file management tasks.

Inclus

1 vidéo1 devoir

In this module, we will explore how to loop through multiple files in Python. You will learn why and how to loop through files efficiently, processing each file's content line by line. By the end, you’ll be ready to tackle scenarios where you need to handle multiple files simultaneously.

Inclus

1 vidéo1 devoir

In this module, we will explore Python's fileinput module as an easier alternative to manually opening files for iteration. You will learn how to leverage this module to simplify looping through file lines, making your code more efficient and concise. By the end, you’ll be equipped to use fileinput for more streamlined file processing.

Inclus

1 vidéo1 devoir

In this module, we will delve into advanced file handling by using the fileinput module to iterate over multiple files. You will compare this approach with the traditional open() method and learn the advantages of using fileinput for handling multiple files simultaneously. By the end, you'll be able to efficiently process and loop through data across multiple files with ease.

Inclus

1 vidéo3 devoirs

Instructeur

Packt - Course Instructors
Packt
1 749 Cours494 468 apprenants

Offert par

Packt

En savoir plus sur Software Development

Pour quelles raisons les étudiants sur Coursera nous choisissent-ils pour leur carrière ?

Felipe M.

Étudiant(e) depuis 2018
’Pouvoir suivre des cours à mon rythme à été une expérience extraordinaire. Je peux apprendre chaque fois que mon emploi du temps me le permet et en fonction de mon humeur.’

Jennifer J.

Étudiant(e) depuis 2020
’J'ai directement appliqué les concepts et les compétences que j'ai appris de mes cours à un nouveau projet passionnant au travail.’

Larry W.

Étudiant(e) depuis 2021
’Lorsque j'ai besoin de cours sur des sujets que mon université ne propose pas, Coursera est l'un des meilleurs endroits où se rendre.’

Chaitanya A.

’Apprendre, ce n'est pas seulement s'améliorer dans son travail : c'est bien plus que cela. Coursera me permet d'apprendre sans limites.’
Coursera Plus

Ouvrez de nouvelles portes avec Coursera Plus

Accès illimité à 10,000+ cours de niveau international, projets pratiques et programmes de certification prêts à l'emploi - tous inclus dans votre abonnement.

Faites progresser votre carrière avec un diplôme en ligne

Obtenez un diplôme auprès d’universités de renommée mondiale - 100 % en ligne

Rejoignez plus de 3 400 entreprises mondiales qui ont choisi Coursera pour les affaires

Améliorez les compétences de vos employés pour exceller dans l’économie numérique

Foire Aux Questions