0

i am working on 'wolframalpha' api and i am keep getting this error, i tried to search but not getting any working post on this error if you know please help me to fix this error

  File "jal.py", line 9
    app_id=’PR5756-H3EP749GGH'
           ^
SyntaxError: invalid syntax

please help; i have to show project tomorrow :(

my code is

#!/usr/bin/env python
# -*- coding: utf-8 -*-

import wolframalpha
import sys


app_id=’PR5756-H3EP749GGH'

client = wolframalpha.Client(app_id)

query = ‘ ‘.join(sys.argv[1:])
res = client.query(query)

if len(res.pods) > 0:
texts = “”
pod = res.pods[1]
if pod.text:
texts = pod.text
else:
texts = “I have no answer for that”
# to skip ascii character in case of error
texts = texts.encode(‘ascii’, ‘ignore’)
print texts
else:
print “Sorry, I am not sure.”
Aaditya Ura
  • 12,007
  • 7
  • 50
  • 88

1 Answers1

1

You used a backtick (´) instead of a single-quote (').

app_id='PR5756-H3EP749GGH'

Python directly shows you the error. Also, use an editor with text highlighting.

styvane
  • 59,869
  • 19
  • 150
  • 156
Sebastian
  • 755
  • 3
  • 7
  • 22