'r' is the default processing mode : open « File « Python Tutorial






f = open('data.txt')                 # 'r' is the default processing mode

bytes = f.read(  )                   # Read entire file into a string
print bytes 
print bytes.split(  )                # File content is always a string








12.9.open
12.9.1.Access Modes for File Objects
12.9.2.'r' is the default processing mode
12.9.3.Open a file for reading
12.9.4.Open a file for writing
12.9.5.Opening a Nonexistent File
12.9.6.Opening a File and check its mode
12.9.7.Reading and Writing