Python Code- Help me in writing code

HI, I am also using my bulb as an indicator. I need to send a Twilio SMS if my bulb turns ON. I am using my VMware and ubuntu server iso on my pc. Can anyone send the code for the above statement.

Your program should be to check whether the bulb is on or off. If the bulb is on you should get SMS notification.

Hope you get it. Do reply me for further if any issue arises.

@nazirahammed98 Yes. I want the code for the same scenario. Help me in, If bulb is ON I should get sms. Ignore the scenario of bulb turning OFF.

@nazirahammed98 I hope that works. But I am turning ON my led by IFTTT with google assistant and webhooks. The code part is just to send messages knowing that my led is ON.
Whether the following code is ok to do that:

If not correct me with the exact code required.

The query which you are asking then you have to you use while loop which will run infinitely and provide you sms after every loop until your led is switched off.

Where to insert while Sir? Whether the code is correct so that it meets my requirements?

insert while statement before the time.sleep() statement and also do check for rest of the indentation.
while True:
so on…

@nazirahammed98 Sir what class should I import to make use of calling in twilio.
Pls help me and expecting a reply since it’s urgent.

Sorry for the late reply, to make use of twilio you have to import
from import Client
then in client class there is a function called calls function
client = Client(conf.TWILIO_SID,conf.TWILIO_AUTH_TOKEN)
call = client.calls.create(conf.TO_NUMBER, conf.FROM_NUMBER,url=“”)

if any assistance do reply


Thanks sir for your reply.I have been searching a lot for this.I will try this code and respond.