Real Time Button Read

I want to read button real time in Jetson TX2 with python.
What should I do?
Thank you.

You can have below lib to read the GPIO status if it’s connect to GPIO pin.

Thank you,
I want to read GPIO pin real time. The library use works slowly so I can’t read the sensor real time.

Below may help.

https://processors.wiki.ti.com/index.php/Linux_PSP_GPIO_Driver_Guide#Useful_docs
https://www.mjmwired.net/kernel/Documentation/gpio.txt