Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use python to send text messages to your mobile phone

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

How to use python to send text messages to their mobile phones, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain for you in detail, people with this need can come to learn, I hope you can gain something.

No bb,show your codefrom twilio.rest import Client # Guide package

Account_sid = 'ACc36bf50712a28f0ac74948531d1786d'

Auth_token = 'd97b85844f9d6a8762f916bdad4c903'

Client = Client (account_sid, auth_token)

Message = client.messages.create (

From_ ='+ 13022447113'

Body = 'Welcome to follow a row of data'

To ='+ 8618375341578'

)

Print (message.sid)

After running, we will see the result.

Collect SMS messages. Jpg usage process

Of course, there is no free lunch in the world. If you can use this function, someone must be paying for you. This is a service provider in Indonesia providing you silently.

Let's get started, _

one。 Install twiliopip install twilio

two。 Register twilio2.1 to open the URL https://www.twilio.com

Select Get a free API key

2.2 in the registration information, the company name is optional and fill in the rest.

WHICH PRODUCT DO YOU PLAN TO USE FIRST?

I chose SMS here.

WHAT ARE YOU BUILDING?

I chose Phone Verification here.

CHOOSE YOUR LANGUAGE

2.3 Verification section

After filling in your mobile phone number, you can verify it by SMS or select call you insteaded for phone verification.

three。 Use

After the registration is successful, you come to the console panel. Write down ACCOUNT SID and AUTH TOKEN, which will be used in the program. Then Get Started will get your twilio phone number.

Fill in your corresponding value and mobile phone number according to the comments in the code, and then run it.

You can use twilio to make phone calls, or you can use your cell phone to send text messages to twilio.

More practical scenarios:

Monitor the situation of your server, and if anything happens to the program or server, you can be informed by text message.

Write an alarm program, combine the sensor, monitor the situation at home and let you know.

Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report