1

我正在尝试使用它构建一个应用程序 - https://github.com/awslabs/amazon-rekognition-video-analyzer/ 不幸的是,我在 build.py 文件中遇到了语法错误。

def write_dir_to_zip(src, zf):
'''Write a directory tree to an open ZipFile object.'''
abs_src = os.path.abspath(src)
for dirname, subdirs, files in os.walk(src):
    for filename in files:
        absname = os.path.abspath(os.path.join(dirname, filename))
        arcname = absname[len(abs_src) + 1:]
        print 'zipping %s as %s' % (os.path.join(dirname, filename),
                                    arcname)
        zf.write(absname, arcname)

我得到的错误如下

 File "build.py", line 26
 arcname)) zf.write(absname, arcname)
          ^
 SyntaxError: invalid syntax

提前致谢!

4

0 回答 0