Project 10 line 1 column 1 error

response_email = mailer.send_email (“Alert”, " current temperature sensor value is: "+ str(data[‘value’])
response_text = json.loads(response_email.text)
print("Response received from Mailgun is: " + str(response_text[‘message’]))

Put this on the email part

Try this @swastishree10 this will work

I did this now error is
Name response email is not defined

Have you changed both the parts? Because above line defines it.

Look, you haven’t done the first line.

Yes I did now but again that column 1 line 1 error is there

And you have defined response=mybolt.analogRead(A0’) twice.
Correct that.

while True: 
    print ("Reading sensor value")
    response = mybolt.analogRead('A0') 
    data = json.loads(response) 
    print("Sensor value is: " + str(data['value']))
        sensor_value = int(data['value']) 

follow this

Yes yes now no error program is running

@swastishree10 make sure that the variables defined in the file there is no semantic error. Make sure that the variable strings are enclosed in double quotes

Your responses were defined twice.

Sorry’ still error is there column line

Share the screenshot of email conf file

1 Like

Okay…I am checking them

Even if you can’t find a mistake then do:

  1. In your initial file write a single repsonse statement for reading value from AO pin.

  2. Correct the spelling of response variable

I have done point 2 spelling is right now…and what’s your 1st point? I have read value from pin in temp_email file…

In the starting of while loop, you have once declared response variable for printing Sensor value and just below that again used the repsonse variable to fetch value.

One is enough

There is similar error in forum but it too is not solved :confused:…line 1column 1 error