Have you considered using Betting Assistant to do it for you instead of Python?
BA integrates well with excel and there are example sheets here
viewtopic.php?f=8&t=3557 where you can simply enter the selections.
If you need to go down the solely python route you'd be better off having python download the race markets from Betfair to get the correct eventID's so everything would match up exactly for each market.