Module: utils.compat3

Routines for Python 3 compatibility

These are in addition to the nibabel.py3k routines.

nipy.utils.compat3.open4csv(fname, mode)

Open filename fname for CSV IO in read or write mode


fname : str

filename to open

mode : {‘r’, ‘w’}

Mode to open file. Don’t specify binary or text modes; we need to chose these according to python version.


fobj : file object

open file object; needs to be closed by the caller