File modes in Python PREMIUM

Series: Files
Trey Hunner smiling in a t-shirt against a yellow wall
Trey Hunner
5 minute read Python 3.7—3.10
Python Morsels
Watch as video
03:34

Let's talk about file modes in Python.

Read mode (the default)

The default mode when you open a file is r or rt for read mode:

...

A Python Tip Every Week

Need to fill-in gaps in your Python skills? I send weekly emails designed to do just that.

Python Morsels
Watch as video
03:34