问题描述:

python3-invalid syntax error

File "6_1.py", line 8

SyntaxError: invalid syntax

But there is no line 8. So what is the problem.

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]

网友答案:

No, but Python thinks there should be because line 7 is not complete:

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

There is a closing ) missing at the end.

相关阅读:
Top