Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Access Modes

The access mode parameter specifies the types of modifications that can be made to the file. It can also specify the type of data or information contained in the file.

Possible access mode parameters:

ParameterNameDescription
"r"ReadOpens a file for reading; also the default value
"a"AppendOpens the file for appending new or additional information; Creates the file if it does not already exist
"w"WriteOpens the file for writing new information; Creates the file if it does not already exist
"x"CreateCreates the file if it does not already exist

Additionally, we can specify the type of data contained in the file, or how Python should handle the information in the file.

ParameterNameDescription
"t"TextTreats file as text data; also the default value
"b"BinaryTreats the file as binary data