#!/usr/bin/env python3
import re
fasta=open("Python_07.fasta","r")
for line in fasta:
	line=line.rstrip()
	#if line.startswith(">"):
	for found in re.finditer(r">(\S+)\s(.+)",line): #use  a for loop. otherwise this doesn't work	
		#found=re.findall(r"(\S+)(.+)",line)
			ID=found.group(1)
			description=found.group(2)
			print("ID:",ID)
			print("Description:",description)
print("All done")

c4d21db220945b839913bf7f18221c10a5beef8d
<mask token>

<mask token>
for line in fasta:
    line = line.rstrip()
    for found in re.finditer('>(\\S+)\\s(.+)', line):
        ID = found.group(1)
        description = found.group(2)
        print('ID:', ID)
        print('Description:', description)
print('All done')

<mask token>
fasta = open('Python_07.fasta', 'r')
for line in fasta:
    line = line.rstrip()
    for found in re.finditer('>(\\S+)\\s(.+)', line):
        ID = found.group(1)
        description = found.group(2)
        print('ID:', ID)
        print('Description:', description)
print('All done')

import re
fasta = open('Python_07.fasta', 'r')
for line in fasta:
    line = line.rstrip()
    for found in re.finditer('>(\\S+)\\s(.+)', line):
        ID = found.group(1)
        description = found.group(2)
        print('ID:', ID)
        print('Description:', description)
print('All done')

#!/usr/bin/env python3
import re
fasta=open("Python_07.fasta","r")
for line in fasta:
	line=line.rstrip()
	#if line.startswith(">"):
	for found in re.finditer(r">(\S+)\s(.+)",line): #use  a for loop. otherwise this doesn't work	
		#found=re.findall(r"(\S+)(.+)",line)
			ID=found.group(1)
			description=found.group(2)
			print("ID:",ID)
			print("Description:",description)
print("All done")
