Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/281.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 中断语法错误:语法错误_Python_Syntax_Break - Fatal编程技术网

Python 中断语法错误:语法错误

Python 中断语法错误:语法错误,python,syntax,break,Python,Syntax,Break,我的休息怎么了?我不明白为什么在我编译代码时,它会在我的休息时说无效语法 for index, (start, end) in enumerate(searchPFAM(fname)): with open('output_'+uniprotID+'-%s.txt' % index,'w') as fileinput: print start, end for item in lookup[uniprotID]:

我的休息怎么了?我不明白为什么在我编译代码时,它会在我的休息时说无效语法

for index, (start, end) in enumerate(searchPFAM(fname)):            
    with open('output_'+uniprotID+'-%s.txt' % index,'w') as fileinput:
        print start, end
        for item in lookup[uniprotID]:
            item, start, end = map(int, (item, start, end)) #make sure that all value is int
            if start <= item <= end:
                print item
                result = str(item - start)
                fileinput.write(">{0} | at position {1} \n".format(uniprotID, result))
                #text = fileinput.write(''.join(makeList[start-1:end]))
                textwrap.fill(''.join(makeList[start-1:end],width = 60)
                break
            else:
                fileinput.write(">{0} | N/A\n".format(uniprotID))
                #text = fileinput.write(''.join(makeList[start-1:end]))
                textwrap.fill(''.join(makeList[start-1:end],width = 60)
对于枚举(searchPFAM(fname))中的索引(开始、结束):
以open('output'+uniprotID+'-%s.txt'%index,'w')作为文件输入:
打印开始、结束
对于查找[uniprotID]中的项:
item,start,end=map(int,(item,start,end))#确保所有值都是int

如果开始这一行缺少右括号:

textwrap.fill(''.join(makeList[start-1:end],width = 60)
#            ^       ^                                ^
应该是这样的:

textwrap.fill(''.join(makeList[start-1:end]),width = 60)

此行缺少右括号:

textwrap.fill(''.join(makeList[start-1:end],width = 60)
#            ^       ^                                ^
应该是这样的:

textwrap.fill(''.join(makeList[start-1:end]),width = 60)

前一行缺少右括号。

前一行缺少右括号。

是否区分制表符,而else:语句是否与for语句一致?我知道py对此很敏感。如果这有帮助的话,我可以把它作为一个答案吗?它是标签敏感的吗?你的else:声明和for声明一致吗?我知道py对此很敏感。如果有帮助的话,我可以把它作为一个回答吗?很好。。谢谢,但应该是结尾后的括号]是的,谢谢,我修好了。接得好。。谢谢,但应该是结尾后的括号]是的,谢谢,我修好了。