import os

# Open file:
# Get file path
dirpath = os.path.dirname(__file__)
file = os.path.join(dirpath, 'lesson8_fileIO.txt')

# Open file (mode default: r = Read only)
open(file)
print('Open file with default mode.')

# Open file (mode: r+ = Read and Writte)
open(file, 'r+')
print('Open file with Read & Writte mode.')

c0cfa1052f1e07d603bbdcd7020aa2c866ca9bd4
<mask token>

<mask token>
open(file)
print('Open file with default mode.')
open(file, 'r+')
print('Open file with Read & Writte mode.')

<mask token>
dirpath = os.path.dirname(__file__)
file = os.path.join(dirpath, 'lesson8_fileIO.txt')
open(file)
print('Open file with default mode.')
open(file, 'r+')
print('Open file with Read & Writte mode.')

import os
dirpath = os.path.dirname(__file__)
file = os.path.join(dirpath, 'lesson8_fileIO.txt')
open(file)
print('Open file with default mode.')
open(file, 'r+')
print('Open file with Read & Writte mode.')

import os

# Open file:
# Get file path
dirpath = os.path.dirname(__file__)
file = os.path.join(dirpath, 'lesson8_fileIO.txt')

# Open file (mode default: r = Read only)
open(file)
print('Open file with default mode.')

# Open file (mode: r+ = Read and Writte)
open(file, 'r+')
print('Open file with Read & Writte mode.')
