Can someone help me with this python code? When I run it, nothing happens. No errors or anything weird to me. It reads in and opens the file just fine. I have a set of protein sequence in Fasta format and I have to find motifs of my sequence like "RRTxSKxxxxAxxRxG" I have to find a sequence where x is written
this is my python code
import re
userinput = input("Please provide a FASTA file.")
while userinput:
try:
if userinput == "0":
break
with open(userinput, mode = 'r') as protein:
readprotein = protein.read()
matches = re.findall('RTxSKxxxxAxxRxG', readprotein)
for match in matches:
print(match)
break
except FileNotFoundError:
print("File not found. enter the fasta file.")
userinput = input("Please provide a FASTA file. 0 to quit.")