File manipulation¶
-
pshell.
concatenate
(input_fnames, output_fname, mode='w', **kwargs)¶ - Concatenate files. Python equivalent of
cat input_fnames[0] input_fnames[1] ... > output_fname.
param input_fnames: sequence of str. Paths to one or more input text files, to be appended one after the other to the output. param str output_fname: Path to output text file, which may or may not already exist. param str mode: Mode for opening the output file e.g. ‘w’ or ‘ab’. Defaults to text mode unless ‘b’ is explicitly declared. param kwargs: Passed verbatim to all the underlying pshell.open()
calls. Among other things, this means that this function can transparently deal with compressed files by inspecting their extension; different files can use different compression algorithms as long as you usecompression='auto'
(the default).If the output is opened in text mode, the inputs will be too; if any file does not terminate with ``
- ``, it will be added. If the output is opened
- in binary mode, the inputs will too; no extra bytes will be added between files.