Sending triggers for stimuli pairs using excel

If this template helps then use it. If not then just delete and start from scratch.
Hello,
I would like to send triggers via a serial port using psychopy.

Here is my experiment:
The experiment is composed of 3 phases:
A familiarization phase during which 6 images are presented 5 times each in a random order. For this I created an excel table with the 6 images and I created a loop in psychopy to present this list 5 times in a random way. I would like to send a trigger to each image that appears.

Then there is a learning phase, during which the participants have to learn 3 pairs of the stimuli they saw during the familiarization phase. I have created an excel spreadsheet to randomize two lists of stimuli with a single loop.
For this phase I would like to send one trigger per pairs.

The last phase is the test phase, which follows an oddball paradigm: in 90% of the cases the pairs presented are those learned during the learning phase and in 10% of the cases the pairs presented are unexpected. I have created an exact table to randomize two lists of stimuli with a single loop, as in the learning phase
For this phase I would like to send one trigger per pairs and one trigger for each unexpected pairs.

If anyone has an idea how to send the triggers?
Any help would be appreciated