googlefinance python3 错误

googlefinance python3 error


大家好,我正在使用 python3 并安装了 googlefinace 模块 (https://pypi.python.org/pypi/googlefinance),示例表明它可以工作

>>> from googlefinance import getQuotes
>>> import json
>>> print json.dumps(getQuotes('AAPL'), indent=2)

但我使用我的终端访问输入此代码 python3

>>> from googlefinance import getQuotes
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/googlefinance/__init__.py", line 55
    print "url: ", url
            ^
SyntaxError: Missing parentheses in call to 'print'

请问有什么问题吗

在python3 打印语法中包含括号。因为它给你语法错误。使用正确的打印语法。 print (url)