我运行了Twilio发送文本的示例代码,代码来源于:https://www.twilio.com/docs/libraries/python,我的代码是:
from twilio.rest import TwilioRestClient,
account_sid = "{{ Account 510 from www.twilio.com/console }}"
auth_token = "{{ Auth Token from www.twilio.com/console }}"
client = TwilioRestClient(account_sid, auth_token)
message = clientmessages.create(body="You are the best!",
to="your phone number",
from_="your Twilio number")
print(message.sid)
我已经使用pip安装了Twilio,为什么会出现这个问题,请帮忙解决~以下是我的代码副本:
from twilio.rest import TwilioRestClient;
account_sid = "{{ ACCOUNT_SID }}" # Your Account SID from www.twilio.com/console
auth_token = "{{ AUTH_TOKEN }}" # Your Auth Token from www.twilio.com/console
client = TwilioRestClient(account_sid, auth_token)
message = client.messages.create(body="You are the best!",
to="+phonenumber", # Replace with your phone number
from_="+(201) ") # Replace with your Twilio number
print(message.sid)
twilio_api
,当我重新安装它后,它就能正常工作了。 - abk