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_suffix : str
additional suffix
directory : str, optional
directory of the file
delimiter : str, optional
symbol between timestamp and event
clock : expyriment.Clock, optional
an experimental clock
time_stamp : bool, optional
using time stamps, based on the experiment start time, not the current time
-
clock
¶ Getter for clock
-
comment_char
¶ Getter for comment_char
-
delimiter
¶ Getter for delimiter
-
directory
¶ Getter for directory
-
filename
¶ Getter for filename
-
fullpath
¶ Getter for fullpath
-
log
(event, log_event_tag=None)¶ Log an event.
Parameters: event : anything
the event to be logged (anything, will be casted to str)
log_event_tag : numeral or string, optional
if log_event_tag is defined, event file logs the inter-event-intervalls and adds a summary of the intervalls at the end of the file
Returns: log_time : int
the time of logging
-
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: onoff : bool
set logging on (True) or off (False)
Notes
See also design.experiment.set_log_level fur further information about event logging.
-
standard_file_name
¶ Getter for the standard expyriment outputfile name.
Filename: {MAINFILE_NAME}_{SUBJECT_ID}_{TIME_STAMP}{suffix}
-
suffix
¶ Getter for directory
-
warn
(message)¶ Log a warning message.
Parameters: message : str
warning message to log
-
write
(content)¶ Write to file.
Parameters: content : str
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: comment : str
comment to be written (anything, will be casted to str)
-
write_line
(content)¶ Write a text line to files.
Parameters: content : str
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
-