write#
- astropy.io.ascii.write(table, output=None, format=None, Writer=None, fast_writer=True, *, overwrite=False, **kwargs)[source]#
Write the input
tabletofilename. Most of the default behavior for various parameters is determined by the Writer class.See also:
- Parameters:
- table
BaseReader, array_like,str, file-like object,list Input table as a Reader object, Numpy struct array, file name, file-like object, list of strings, or single newline-separated string.
- output
str, file-like object Output [filename, file-like object]. Defaults to``sys.stdout``.
- format
str Output table format. Defaults to ‘basic’.
- delimiter
str Column delimiter string
- comment
str, bool String defining a comment line in table. If
Falsethen comments are not written out.- quotechar
str One-character string to quote fields containing special characters
- formats
dict Dictionary of format specifiers or formatting functions
- strip_whitespacebool
Strip surrounding whitespace from column values.
- names
list List of names corresponding to each data column
- include_names
list List of names to include in output.
- exclude_names
list List of names to exclude from output (applied after
include_names)- fast_writerbool,
str Whether to use the fast Cython writer. Can be
True(use fast writer if available),False(do not use fast writer), or'force'(use fast writer and fail if not available, mostly for testing).- overwritebool
If
overwrite=False(default) and the file exists, then an OSError is raised. This parameter is ignored when theoutputarg is not a string (e.g., a file object).
- table