0

I am using "Python 3.5" from the website "https://www.python.org/" and when i try to run the program provided by HVS it does not work.

C:\Users\sdixit23>python C:\Users\sdixit23\AppData\Local\Programs\Python\Python35-32\Shyam\NotWorking\restfulclient2.py
File      "C:\Users\sdixit23\AppData\Local\Programs\Python\Python35-32\Shyam\NotWorking\restfulclient2.py", line 26 print key + " : " + jData[key] ^ 
SyntaxError: Missing parentheses in call to 'print' C:\Users\sdixit23>

Could you please share another version of a restful API that can work.

This question was also asked here in anothe thread

Community
  • 1
  • 1
  • 1
    "Missing parentheses in call to 'print'" - looks like you need to use python 2.7 (as mentioned in the linked post), or update the code to use print correctly for python 3 – OneCricketeer Jan 26 '16 at 12:14
  • The error message says that you're missing the parenthesis, have you tried adding them? Also, that same script says `#Python 2.7.6` at the beggining, so use Python 2 instead of Python 3. – tglaria Jan 26 '16 at 12:18

2 Answers2

0

You could try adding the parenthesis. In python 3 is neccesary

print(key + " : " + jData[key])
Luis González
  • 3,199
  • 26
  • 43
  • Yes adding parenthesis does help but then it gets stuck at another place. I feel the issue is to do with not using the correct python version. Could you please help me rewrite the program for Python 3? – Ranchoddas shyamaldas chanchad Jan 26 '16 at 13:00
0

You either:
- add the parenthesis that the error tells you to or
- use Python 2 as the script says in the firs line #Python 2.7.6

tglaria
  • 5,678
  • 2
  • 13
  • 17
  • Yes adding parenthesis does help but then it gets stuck at another place. I feel the issue is to do with not using the correct python version. Ok, let me uninstall this python version and install the older version. – Ranchoddas shyamaldas chanchad Jan 26 '16 at 12:58