ansys.dyna.core.lib.io_utils#

Utils for i/o.

Functions#

write_or_return(→ Optional[str])

Write to buffer or returns a string.

Module Contents#

ansys.dyna.core.lib.io_utils.write_or_return(buf: TextIO | None, func: Callable) str | None[source]#

Write to buffer or returns a string.

Uses the callable func to write. If buf is None, then the function will create a string buffer before calling func and return the result as a string.