IO.TextFile import TextFile from Scientific. IO.FortranFormat import FortranFormat, FortranLine from Scientific. The next example shows how to write data in a Fortran-compatible way. The output file contains a sequence of numbers in the first column and their square roots in the second column. IO.TextFile import TextFile from Scientific.
Exercises Write a program that counts the number of lines and words in a file.
The entries are separated by one or more spaces.