Detecting through python if a pushbutton is pressed

Sir i am given a task to control leds using pushbutton via esp8266mod. But i am stuck at “how to detect through python if a pushbutton is pressed”. Through google searches i have found that there is a module for pushbutton, there it can be created and controlled but there is no module or library for hardware pushbutton. I have tried the command if mybolt.digitalRead(‘0’)==‘HIGH’ , but it doesnt work.
Please help if you have any solution regarding this.

hello @sutaraisha123
you just want to check the condition of the push switch in BOLT through right?