Replace your file name with sys.argv[1], import the sys module, and then save your script to call it in a loop from the command line.
Edit: here's the full code you'll need. I discovered that upon reverse complementing, BioPython throws away the header information for some reason, so you need to hack that a bit:
import sys
from Bio import SeqIO
recs = SeqIO.parse(sys.argv[1], 'fastq')
for rec in recs:
rc = rec.reverse_complement()
rc.id = rec.id
rc.name = rec.name + '_R2.fastq'
rc.description = ''
SeqIO.write(rc, rc.name, 'fastq')
Call this in a shell loop to run over all your sequences.:
for file in /path/to/*.fastq ; do
python reverse_complement.py $file
done
(You can do this in a one-liner at the shell prompt if you wish too: for file in /path/to/*.fastq ; do python reverse_complement.py $file ; done)
NOTE
This will make a new file for every reverse complemented read (you can change rc.name in the last line if you don't want this). Also, this will mean the forward and reverse sequences will share the same fastq header name, which may not be ideal. In which case, edit rc.id = rec.id + '_some_string' or whatever you need.
there is no question.