expyriment.io.EventFile
- class expyriment.io.EventFile(additional_suffix, directory=None, delimiter=None, clock=None, time_stamp=None)
A class implementing an event file.
- __init__(additional_suffix, directory=None, delimiter=None, clock=None, time_stamp=None)
Create an event file.
Filename: {MAINFILE_NAME}_{SUBJECT_ID}_{TIME_STAMP}{ADD_SUFFIX}.xpd
- Parameters:
- additional_suffixstr
additional suffix
- directorystr, optional
directory of the file
- delimiterstr, optional
symbol between timestamp and event
- clockexpyriment.Clock, optional
an experimental clock
- time_stampbool, optional
using time stamps, based on the experiment start time, not the current time
- property clock
Getter for clock
- property comment_char
Getter for comment_char
- property delimiter
Getter for delimiter
- property directory
Getter for directory
- property filename
Getter for filename
- property fullpath
Getter for fullpath
- static get_next_subject_number()
Return the next subject number based on the existing data and event files.
- log(event, log_event_tag=None)
Log an event.
- Parameters:
- eventanything
the event to be logged (anything, will be casted to str)
- log_event_tagnumeral or string, optional
if log_event_tag is defined, event file logs the inter-event-intervalls and adds a summary of the intervals at the end of the file
- Returns:
- log_timeint
the time of logging
- property logging
Getter for logging.
- rename(new_filename)
Renames the output file.
- save()
Save file to disk.
- set_logging(onoff)
Set logging of this object on or off
- Parameters:
- onoffbool
set logging on (True) or off (False)
- property standard_file_name
Getter for the standard expyriment outputfile name.
Filename: {MAINFILE_NAME}_{SUBJECT_ID}_{TIME_STAMP}{suffix}
- property suffix
Getter for directory
- warn(message)
Log a warning message.
- Parameters:
- messagestr
warning message to log
- write(content)
Write to file.
- Parameters:
- contentstr
content to be written (anything, will be casted to str)
- write_comment(comment)
Write a comment line to files.
(i.e., text is proceeded by comment char).
- Parameters:
- commentstr
comment to be written (anything, will be casted to str)
- write_line(content)
Write a text line to files.
- Parameters:
- contentstr
content to be written (anything, will be casted to str)
- write_list(list_)
Write a list in a row. Data are separated by a delimiter.
- Parameters:
- list_list
list to be written