python编程新手请教各位大侠:读取文件名为变量的一系列文件的脚本
while i < 9:dirs = os.listdir('sequence')
print dirs
for d in dirs:
print d
inputDNAfile = open(d,'r')
PDBline = inputDNAfile.readline()
显示的错误信息是
['g000001.fasta', 'g000002.fasta', 'gene.fasta', 'g000003.fasta']
g000001.fasta
Traceback (most recent call last):
File "./stepmutate.py", line 21, in <module>
inputDNAfile = open(d,'r')
IOError: [Errno 2] No such file or directory: 'g000001.fasta'
可是我的文件夹sequence中的确是有g000001.fasta文件的阿,所以就很迷茫阿,初次接触python语言编写脚本,望各位大侠广伸援手!