import wiringpi as wpi
from time import sleep

DIGITAL_PUSH_BUTTON = 21

wpi.wiringPiSetup()
wpi.pinMode(DIGITAL_PUSH_BUTTON, wpi.INPUT)

count = 0

try:
	while True:
		if wpi.digitalRead(DIGITAL_PUSH_BUTTON) == wpi.HIGH:
			count = count + 1
			print("Button pressed " + str(count) + " times")
			while wpi.digitalRead(DIGITAL_PUSH_BUTTON) == wpi.HIGH:
				pass
			sleep(0.5)
				
except KeyboardInterrupt:
	print("exit")
@@ -129,16 +129,71 @@
 i.INPUT)
+%0Awpi.pullUpDnControl(DIGITAL_PUSH_BUTTON, wpi.PUD_DOWN)
 %0A%0Acount 
@@ -470,8 +470,9 @@
 (%22exit%22)
+%0A

Update Click_Counter.py