Skip to content

Instantly share code, notes, and snippets.

@jakewilliami
Created February 24, 2021 04:19
Show Gist options
  • Save jakewilliami/9d5e14e7161a4ffe2aee9f24a83e51cf to your computer and use it in GitHub Desktop.
Save jakewilliami/9d5e14e7161a4ffe2aee9f24a83e51cf to your computer and use it in GitHub Desktop.
import random
# f = open(experiment_path + '/' + 'subject-' + str(subject_nr) + '-auxiliary.csv', 'a') # this will create an auxiliary datafile for participant (`subject_nr` is a predefined variable)
f = open(logfile, 'a') # this will append to the log file (`logfile` is a predefined variable)
f.write('ISI,\n')
for ISI in [[1900, 2000, 2100][random.randint(0, 2)] for _ in range(100)]:
f.write(str(ISI) + ',\n')
f.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment