我正在编写'wolframalpha‘api,我一直在获取这个错误,我试图搜索,但是没有得到任何关于这个错误的工作帖子,如果您知道请帮助我修复这个错误
File "jal.py", line 9
app_id=’PR5756-H3EP749GGH'
^
SyntaxError: invalid syntax请帮帮忙,我明天要展示项目:
我的代码是
#!/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.”发布于 2016-02-15 13:52:43
您使用的是回勾(´)而不是单引号(')。
app_id='PR5756-H3EP749GGH'Python直接显示错误。同时,使用带有文本高亮显示的编辑器。
https://stackoverflow.com/questions/35411088
复制相似问题