Join us and get access to thousands of tutorials and a community of expert Pythonistas.

Unlock This Lesson

This lesson is for members only. Join us and get access to thousands of tutorials and a community of expert Pythonistas.

Unlock This Lesson

Hint: You can adjust the default video playback speed in your account settings.
Hint: You can set your subtitle preferences in your account settings.
Sorry! Looks like there’s an issue with video playback 🙁 This might be due to a temporary outage or because of a configuration issue with your browser. Please refer to our video player troubleshooting guide for assistance.

Reading and Writing Files in Python: Summary

In this course, you learned about reading and writing files in Python. You covered everything from what a file is made up of to which libraries can help you along that way. You also took a look at some basic scenarios of file usage as well as some advanced techniques.

You now know what makes up a file and why that’s important in Python, the basics of reading and writing files in Python, and some basic scenarios of reading and writing files.

Abby Jones on July 10, 2019

Fantastic course!

aradim on July 13, 2019

EXCELLENT COURSE! Thank you

andersgs on July 14, 2019

Thank you. I learned about bpython and the pattern:

python if input() == 'x': break

That will be very useful.

For manipulating paths, however, I do prefer pathlib (docs.python.org/3/library/pathlib.html). I think the PEP around the rationale for pathlib is worth a read (www.python.org/dev/peps/pep-0428/).

Thank you again for the great tutorial.

Robert on July 14, 2019

Very nice,

Watching it is helping me to get through an area where I’ve been stuck. I’ll be back to watch several times and type it out, such is my memory ( need an upgrade!).

Thank you,

sion on July 26, 2019

Covered the basics and useful extensions of them. Well presented, thank you.

ALXTheMaster on July 31, 2019

Great course! i like when you keep writing the code again and again, that just makes me better just by watching, by the time i opened pycharm, i was distracted doing something else, but then i challenged myself to write the code by not looking at the video after 35 minutes and guess what, i am a beginner and it got stock in my head. THANK YOU!

michelnakhla on Aug. 25, 2019

Excellent and clear.

michelnakhla on Nov. 25, 2019

Great course, professionally done.

Victor Amadi on Nov. 29, 2019

Really informative. Thanks Darren.

markthiele on March 19, 2020

Thanks, very useful!

Cristian Palau on April 10, 2020

Thank you!

pshapard on April 12, 2020

Thanks for this course.

Howard M Sherman on April 22, 2020

I’m sort of a newbie to Python, and I believe that this course would be much richer if it gave some more background information to some fundamental topics such as: text vs. binary data; reading files a line at a time vs. reading the whole file into memory at once; unicode data and its utf-8 encoding vs. ascii; etc. Reading and writing files is a fundamental skill for Python or any other programming language, and I just feel this course was a bit short on the background information needed for one who isn’t already experienced in Python to benefit.

Dan Bader RP Team on April 22, 2020

Thanks for your feedback Howard! This course is intended for an intermediate skill level. If you’re looking for an introduction to working with files in Python, I’d like to recommend the following resources:

beingpython on Aug. 29, 2020

Very well done!

Ghani on Nov. 2, 2020

Nice and simple introduction to the subject; thanks a lot!

Eriberto on Nov. 6, 2020

Love the course, good job by the author. Would have been more great if exercise files were added to the resources link. Yeah, I know there is supplementary post related to this like realpython.com/read-write-files-python/#what-is-a-file but the exercises presented can be a good hands on to follow along if exercise files were added. Overall thumbs up to Darren.

scottbeecher on July 30, 2021

Excellent layout; nicely paced.

nickyniu123 on Aug. 27, 2023

Very good course.

Become a Member to join the conversation.