【发布时间】:2017-03-28 00:02:32
【问题描述】:
我一方面是 Windows 7 和 Python 2.7.12,另一方面是 Red Hat Enterprise Linux Server 版本 6.5 和 Python 2.6.6。
我有一个脚本可以在 Windows 上正常运行,但在 RHEL 上却不行。
我收到以下语法错误:
with open('pathtofile', 'rb') as f_input, open('pathtofile', 'w') as f_output:
# ^
SyntaxError: invalid syntax
可能是两个系统的Python版本不同造成的?
【问题讨论】: