from Bio import SeqIO
import re, os
import pandas as pd
from Bio.Seq import Seq
from Bio.Alphabet import generic_dna
from Bio.SeqRecord import SeqRecord
os.chdir('c:\\Users\Workspace\\Desktop')
f_out = os.path.join(os.getcwd(),'convertedgisaid','pandemic2009.txt')
fileNameStruct = "pandemic2009p"
fileCount = 0
fout = open(f_out,'w')
number_of_files = 5
while(fileCount<number_of_files):
f_in = os.path.join(os.getcwd(),'convertedgisaid',fileNameStruct+str(fileCount)+".txt")
f = open(f_in,'r')
records = f.read()
records = re.sub("_"," ",records)
records = records.split('\n')
records = records[1:]
for rec in records:
current = rec.split('|')
fout.write(current[0]+" "+rec[-1:]+"\n")
fileCount+=1
fout.close()
无法运行.py文件,但是python中的所有代码都可用!还有一个原因是python不能识别我的标签吗?你知道吗
对不起,我是这里的初学者:(
尝试重新格式化代码,例如使用http://www.cleancss.com/python-beautify/
您可以在这里阅读有关如何格式化代码的更多信息:https://www.python.org/dev/peps/pep-0008/#tabs-or-spaces
相关问题 更多 >
编程相关推荐