Twilio - 发送短信时的Python异常 - Udacity教程

时间:2016-05-17 17:26:16

标签: python sms twilio

我按照Udacity的{​​{1}}教程进行操作,我得到如下例外情况:

Twilio

代码:

Traceback (most recent call last):
  File "/Users/kaushiksekar/Documents/Programs/Python/send_text.py", line 10, in <module>
    from_="+14066234282") # Replace with your Twilio number
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/twilio-6.3.dev0-py2.7.egg/twilio/rest/resources/messages.py", line 122, in create
    return self.create_instance(kwargs)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/twilio-6.3.dev0-py2.7.egg/twilio/rest/resources/base.py", line 365, in create_instance
    data=transform_params(body))
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/twilio-6.3.dev0-py2.7.egg/twilio/rest/resources/base.py", line 200, in request
    resp = make_twilio_request(method, uri, auth=self.auth, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/twilio-6.3.dev0-py2.7.egg/twilio/rest/resources/base.py", line 164, in make_twilio_request
    uri=resp.url, msg=message, code=code)
TwilioRestException: 
[31m[49mHTTP Error[0m [37m[49mYour request was:[0m

[36m[49mPOST https://api.twilio.com/2010-04-01/Accounts/{{ AC142b2a041b9695a2e7d73572cd7989b0 }}/Messages.json[0m

[37m[49mTwilio returned the following information:[0m

[34m[49m[0m

>>> 

关于问题可能是什么的指示?

1 个答案:

答案 0 :(得分:0)

哦,我忘了在定义account_sid和auth_token变量时删除大括号。删除大括号后,它工作正常。

更正后的代码:

%PDF