Writing python code for callback functionality binded with gpio class from c-code