How To Detect Button Input In Python