-1

i want to make a hand gesture that can take a photo.. so after making the hand gesture there will be a countdown time to take the photo but I am still a beginner in python so I don't understand about the error..

code 1

code 2

code 3

code 4

code 5

1 Answers1

0

Look like you have made a change to the variable Take_photo in the function. That's why there is the error here.

You can just simply add global Take_photo and it should work.

Your function should be:

def btn_clicked():
    global Take_photo
    #your code

You might want to have a look at this answer for more detail https://stackoverflow.com/a/50766668/17990633

Hope it works, have a nice day!

Hung
  • 155
  • 10