Logo Search packages:      
Sourcecode: python-scientific version File versions  Download package

Scientific::IO::FortranFormat::FortranLine Class Reference

List of all members.


Detailed Description

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.

Definition at line 61 of file FortranFormat.py.


Public Member Functions

def __getitem__
def __getslice__
def __init__
def __len__
def __str__
def isBlank

Public Attributes

 data
 format
 length
 text

Private Member Functions

def _input
def _output

The documentation for this class was generated from the following file:

Generated by  Doxygen 1.6.0   Back to index