Input and output

Splipy supports reading from and writing to a number of different file formats. This is handled through a number of classes in the splipy.io module, each of which have identical interfaces (although not all formats support all functions).

The file objects are intended to be used as context managers, i.e.

with G2('some_file.g2') as f:
    f.write(...)
    objs = f.read()

The available formats are:

Common interface

class splipy.io.master.MasterIO(filename)
__init__(filename)

Create an IO object attached to a file.

Parameters:filename (str) – The file to read from or write to
read()

Reads all the objects from the file.

Returns:Objects
Return type:[splipy.SplineObject]
write(obj)

Write one or more objects to the file.

Parameters:obj ([splipy.SplineObject] or splipy.SplineObject) – The object(s) to write