How To Create Callback Function In Python