Thanks for the reply, I'll just use that script for now.
For 1) though, I know blast_results is just a file handler. However Python should be able to recognise it as text. I read redcord.id as a string with str() once too, and Python should definitely be able to just search for a string in a text file, right? What's the deal with needing to specifically find the location of each ID based on the format?
And I'm confident my IDs in the flank file are in the correct format because I generated them myself without any spaces
AC068207.60 [...]
AP006305.11
And even if I didn't, record.id and the blast results should still have the same relevant parts
Thanks for the suggestion to get rid of list(), that's just something I got used to when I was using two for loops to check every possible combination of IDs between two files and they needed to be lists because as generator objects I couldn't get the loop to start reading from the beginning of the file for every new iteration so it just stopped after reading through one ID in one file and the entirety of the other file. You don't need it if there's just one for loop