Package Scientific :: Package IO :: Module FortranFormat

[frames] | no frames]

# Module FortranFormat

Fortran-style formatted input/output

This module provides two classes that aid in reading and writing Fortran-formatted text files.

Examples:

     Input::

       >>>s = '   59999'
       >>>format = FortranFormat('2I4')
       >>>line = FortranLine(s, format)
       >>>print line[0]
       >>>print line[1]

     prints::

       >>>5
       >>>9999

     Output::

       >>>format = FortranFormat('2D15.5')
       >>>line = FortranLine([3.1415926, 2.71828], format)
       >>>print str(line)

     prints::

       '3.14159D+00    2.71828D+00'

Classes
| FortranFormat Parsed Fortran-style format string
| FortranLine Fortran-style record in formatted files