for i in seqsamples:
    linesamples.add(int(4 * i + 0))
linesamples.add(int(4 * i + 1))
linesamples.add(int(4 * i + 2))
linesamples.add(int(4 * i + 3))
line_num = 0
for line in infile:
    if line_num in linesamples:
        outputfile.write(line)
line_num += 1
outputfile.close()
How can I make my Python script faster?