Lichen

tests/read_file.py

347:17317598efd2
2016-12-08 Paul Boddie Added support for fopen and opening files. Moved common stream functionality into the __builtins__.file module. Moved common type checking functionality into the __builtins__.types module.
     1 try:     2     f = open("tests/read_file.py")  # this file!     3 except IOError, exc:     4     print "I/O error occurred:", exc.value     5     raise     6      7 try:     8     s = f.read(5)     9     print s                         # try:    10     s = f.read(49)    11     print s                         #     f = open("tests/read_file.py")   # this file!    12     s = f.read()    13     print s    14 finally:    15     f.close()