python3在不存在的行上使用无效语法

python3在不存在的行上使用无效语法,python,regex,zipfile,Python,Regex,Zipfile,python3无效语法错误 文件“6_1.py”,第8行 但是没有第8行。那么问题是什么呢 import zipfile,re with ZipFile('../../下载/channel.zip') as myzip: nothing = '90052' rex = re.compile(r'\d+') while True: print(myzip.getinfo(nothing+'txt')) nothing = re.findall

python3无效语法错误

文件“6_1.py”,第8行

但是没有第8行。那么问题是什么呢

import zipfile,re
with ZipFile('../../下载/channel.zip') as myzip:
    nothing = '90052'
    rex = re.compile(r'\d+')
    while True:
        print(myzip.getinfo(nothing+'txt'))
        nothing = re.findall(rex, myzip.open(nothing+'txt')[0]        

没有,但Python认为应该有,因为第7行不完整:

nothing = re.findall(rex, myzip.open(nothing+'txt')[0]        
#              open 1 -------- open 2 ----- close 2 - ^ where is close 1?

结尾处缺少一个结束语。

没有,但Python认为应该有,因为第7行不完整:

nothing = re.findall(rex, myzip.open(nothing+'txt')[0]        
#              open 1 -------- open 2 ----- close 2 - ^ where is close 1?
结尾处有一个结束语
缺失。

请下次发布完整的回溯,而不仅仅是最后一行。对于完整回溯,我指的是从
traceback
开始的行到您发布的行之间的所有内容。请下次发布完整回溯,而不仅仅是最后一行。对于完全回溯,我指的是从
traceback
开始的行到您发布的行之间的所有内容。