| Reference | Downloads | Github

Iohub eye tracking: add datetime to edf filename

Hi All,

I used the demo in psychopy 1.84.2 to create my own task. I’ve got everything working and eye tracking happening with SR Eyelink.

The only problem I’ve run into is that because the edf file gets saved as ‘et_data’, running the experiment again means that file gets rewritten. So how would I go about adjusting the code to add a datetime stamp on the filename so that they don’t get rewritten every time the experiment is run?


Would I be right in thinking that I might need to edit

psychopy/iohub/devices/eyetracker/sr_research/eyelink/ where default_native_data_file_name is defined? If so, how can I make this populate current date/time in the edf filename to replace the ‘et_data’ in iohub_config.yaml

native data recording file

        if default_native_data_file_name:
            if isinstance(default_native_data_file_name,(str,unicode)):
                if default_native_data_file_name>0:
                    if default_native_data_file_name[r:] == 'edf'.lower():

                if len(default_native_data_file_name)>7:
                print2err("ERROR: default_native_data_file_name must be a string or unicode value")

        if self._local_edf_dir and self._full_edf_name:

Hi, cross-posting the very same question at different places is not very nice, or should at least be pointed out explicitly. The reason is that it splits resources and people might end up spending time on an issue that was already resolved elsewhere. This question has been posted on Stack Overflow and already received responses:

Hi Richard,

Yes, we’ve been looking for solutions for this issue and I’ve only just found out about this forum and joined. I asked here hoping to find answers from psychopy users who may also use iohub and have come across the same issues as the response from other post led to more errors rather than fixing the initial problem.

Forgive my ignorance, I’m still learning the etiquettes of such forums.

1 Like