write(self,
file=' results ' ,
dir=' pipe_name ' ,
compress_type=1,
force=False)
| source code
|
Write the results to a file.
Keyword Arguments
~~~~~~~~~~~~~~~~~
file: The name of the file to output results to. The default is 'results'. Optionally this can be
a file object, or any object with a write() method.
dir: The directory name.
compress_type: The type of compression to use when creating the file.
force: A flag which if True will cause the results file to be overwritten.
Description
~~~~~~~~~~~
To place the results file in the current working directory in the prompt and scripting modes, set
dir to None. If dir is set to the special name 'pipe_name', then the results file will be placed
into a directory with the same name as the current data pipe.
The default behaviour of this function is to compress the file using bzip2 compression. If the
extension '.bz2' is not included in the file name, it will be added. The compression can, however,
be changed to either no compression or gzip compression. This is controlled by the compression type
which can be set to
0: No compression (no file extension),
1: bzip2 compression ('.bz2' file extension),
2: gzip compression ('.gz' file extension).
The complementary read function will automatically handle the compressed files.
|