【发布时间】:2018-09-20 07:27:07
【问题描述】:
我正在关注这个repo 来安装files2rouge,然后我收到如下错误:
Traceback (most recent call last):
File "setup_rouge.py", line 7, in <module>
from files2rouge import settings
File "/home/cerdas/files2rouge/files2rouge/__init__.py", line 2, in <module>
from files2rouge.files2rouge import main
File "/home/cerdas/files2rouge/files2rouge/files2rouge.py", line 17, in <module>
from files2rouge import utils
File "/home/cerdas/files2rouge/files2rouge/utils.py", line 16
print(file=saveto, *args, **kwargs)
^
SyntaxError: invalid syntax
这里遇到错误的代码行:
def tee(saveto, *args, **kwargs):
"""Mimic the tee command, write on both stdout and file
"""
print(args, kwargs)
if saveto is not None:
print(file=saveto, *args, **kwargs)
我不知道出了什么问题,也不知道saveto 是干什么用的。请给我一些见解,谢谢。
【问题讨论】:
-
这个问题和the one you asked an hour ago到底有什么不同?
标签: python syntax-error python-2.x rouge