Counting TTL Pulses from launchScan?

Hello,

I am using psychopy.hardware.emulator.launchScan to run fMRI experiments, and the experiment runs completely fine; with log files showing:

5.0228 	EXP 	launchScan: start of scan
...
81.0311 	DATA 	Keypress: quoteleft

correctly showing keypress quote left every two seconds as I have it set. However, I was wondering if there was a way of counting how many of these Keypress: quoteleft are happening as the experiment is progressing. Since the logging is happening in the back of the experiment, I wasn’t sure how I can approach it. Any pointers would be appreciated! Thank you.