With Biopython, you can parse the FASTA file into Sequence objects, split at "R", then BLAST over the internet or run BLAST locally. You can take the results (expressed as SeqRecords, and output them to a FASTA file by iterating over each record.
The documentation has plenty of code samples you can use to piece together what you're looking for.