Fortran-style record in formatted files FortranLine objects represent the content of one record of a Fortran-style formatted file. Indexing yields the contents as Python objects, whereas transformation to a string (using the built-in function 'str') yields the text representation. Constructor: FortranLine(|data|, |format|, |length|='80') Arguments: |data| -- either a sequence of Python objects, or a string formatted according to Fortran rules |format| -- either a Fortran-style format string, or a FortranFormat object. A FortranFormat should be used when the same format string is used repeatedly, because then the rather slow parsing of the string is performed only once. |length| -- the length of the Fortran record. This is relevant only when |data| is a string; this string is then extended by spaces to have the indicated length. The default value of 80 is almost always correct. Restrictions: 1) Only A, D, E, F, G, I, and X formats are supported (plus string constants for output). 2) No direct support for complex numbers; they must be split into real and imaginary parts before output. 3) No overflow check. If an output field gets too large, it will take more space, instead of being replaced by stars according to Fortran conventions.
Public Member Functions
Private Member Functions