Search code examples
python-3.xfinancegoogle-finance

googlefinance python3 error



Hi guys I'm using python3 and install googlefinace module(https://pypi.python.org/pypi/googlefinance) and the example says it's works

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

but I type this code using my terminal access 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'

so what's the problem please help me


Solution

  • In python3 print syntax contains parenthesis. There for it is giving you syntax error. Use correct print syntax. print (url)