psychopy.tools.filetools
¶Functions and classes related to file and directory handling
psychopy.tools.filetools.
toFile
(filename, data)¶Save data (of any sort) as a pickle file.
simple wrapper of the cPickle module in core python
psychopy.tools.filetools.
fromFile
(filename, encoding='utf-8')¶Load data from a pickle or JSON file.
Parameters: | encoding (str) – The encoding to use when reading a JSON file. This parameter will be ignored for any other file type. |
---|
psychopy.tools.filetools.
mergeFolder
(src, dst, pattern=None)¶Merge a folder into another.
Existing files in dst folder with the same name will be overwritten. Non-existent files/folders will be created.
psychopy.tools.filetools.
openOutputFile
(fileName=None, append=False, fileCollisionMethod='rename', encoding='utf-8-sig')¶Open an output file (or standard output) for writing.
Parameters: |
---|
True
, append data to an existing file; otherwise, overwrite
it with new data.
Defaults to True
, i.e. appending.append
is set to True
.
Defaults to rename.'utf-8'
.Returns: |
---|
psychopy.tools.filetools.
genDelimiter
(fileName)¶Return a delimiter based on a filename.
Parameters: |
---|
Returns: |
---|
,
if the filename extension is .csv
, and a tabulator
character otherwise.