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.

@manishraj200015
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:
py

If not correct me with the exact code required.

@manishraj200015
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?

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