# One prong to GND the other to a GPIO pin from gpiozero import Button button = Button(GPIO pin) button.wait_for_press() print("button was pressed")