1

我的代码是:

if any(s in attrs["show"] for s in ("Apple Mac OS","Intel Mac OS")):

错误是:

 if any(s in attrs["show"] for s in ("Apple Mac OS","Intel Mac OS")):
                            ^
 SyntaxError: invalid syntax

我可以在一台机器上成功运行相同的脚本,然后我将它复制到另一台机器,它返回此错误,真的不知道为什么

4

1 回答 1

5

你的机器上有一个旧版本的 Python,它不会运行它。就像,一个非常旧的版本;我相信这个功能是在 Python 2.4 中添加的。

于 2012-08-03T14:43:15.873 回答